Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package side.project;
- import java.awt.Container;
- import java.awt.Dimension;
- import java.awt.FlowLayout;
- import java.awt.image.BufferedImage;
- import java.io.File;
- import java.io.IOException;
- import javax.imageio.ImageIO;
- import javax.swing.ImageIcon;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JPanel;
- import javax.swing.JScrollPane;
- import javax.swing.JTextArea;
- /**
- *
- * @author cthomsen18
- */
- public class SideProject {
- /**
- * @param args the command line arguments
- */
- private static JFrame mainframe;
- private static Container dataplacement;
- private static JTextArea textdata;
- private static ImageIcon iconb;
- private static String j;
- private static BufferedImage img;
- private static int x;
- private static JPanel imgcontainer;
- private static JScrollPane scrollPane;
- private static JScrollPane imgScrollPane;
- private static JLabel lab;
- private static JLabel laba;
- private static JLabel labb;
- private static JLabel labc;
- private static JLabel labd;
- private static JLabel labe;
- private static JLabel labf;
- private static JLabel labg;
- private static JLabel labh;
- private static JLabel labi;
- private static JLabel labj;
- private static JLabel labk;
- private static JLabel labl;
- private static JLabel labm;
- private static JLabel labn;
- private static JLabel labo;
- private static JLabel labp;
- private static JLabel labq;
- private static JLabel labr;
- private static JLabel labs;
- private static JTextArea textArea;
- private static String sc = "C:\\Users\\cthomsen18\\Documents\\NetBeansProjects\\Side Project\\src\\Image Sources";
- private static void changeimg(String stringname, String stringn, String stringr, JLabel las) {
- j = (sc + "\\" + stringn + "\\" + stringr + "\\" + stringname + ".png");
- System.out.println(j);
- img = null;
- try {
- img = ImageIO.read(new File(j));
- } catch (IOException e) {
- }
- iconb = new ImageIcon(img, "Pokemon Image");
- las.setIcon(iconb);
- las.setOpaque(true);
- }
- private static void printstats(int n, int x, String texts, String[] columnNames, String [][] firstevolutiondata) {
- n = 0;
- while ( n < 10 ) {
- texts = texts + columnNames[n] + " : " + firstevolutiondata[x][n] + " \n";
- textArea.setText(texts);
- n++;
- }
- texts = texts + "\n";
- textArea.setText(texts);
- texts = texts + "\n";
- textArea.setText(texts);
- }
- private static void constructGui() {
- String[] columnNames = {"Pokemon Name",
- "Type",
- "Generation",
- "Region",
- "Games Appeared In",
- "Base HP",
- "Base Attack",
- "Base Speed",
- "Base Defense",
- "Level to Evolve",
- "Evolutionary Stage"};
- String[][] firstevolutiondata = {
- {"Pikachu", "Electric", "1", "Kanto", "Yellow", "35", "55", "90", "40", "Thunderstone", "1"},
- {"Charmander", "Fire", "1", "Kanto", "Red, Blue, Green, Fire Red, Leaf Green", "39", "52", "65", "43", "Level 16", "1"},
- {"Bulbasaur", "Grass", "1", "Kanto", "Red, Blue, Green, Fire Red, Leaf Green", "45", "49", "45", "49", "Level 16", "1"},
- {"Squirtle", "Water", "2", "Kanto", "Red, Blue, Green, Fire Red, Leaf Green", "44", "43", "65", "Level 16", "1"},
- {"Cyndaquil", "Fire", "2", "Johto", "Silver, Crystal, Gold, Heart Gold, Soul Silver", "39", "52", "65", "43", "Level 14", "1"},
- {"Chikorita", "Grass", "2", "Johto", "Silver, Crystal, Gold, Heart Gold, Soul Silver", "45", "49", "45", "65", "Level 16", "1"},
- {"Totodile", "Water", "2", "Johto", "Silver, Crystal, Gold, Heart Gold, Soul Silver", "50", "65", "43", "64", "Level 18", "1"},
- {"Torchic", "Fire", "3", "Hoenn", "Sapphire, Ruby, Emerald, Omega Ruby, Alpha Sapphire", "45", "60", "45", "40", "Level 16", "1"},
- {"Treecko", "Grass", "3", "Hoenn", "Sapphire, Ruby, Emerald, Omega Ruby, Alpha Sapphire", "40", "45", "70", "35", "Level 16", "1"},
- {"Mudkip", "Water", "3", "Hoenn", "Sapphire, Ruby, Emerald, Omega Ruby, Alpha Sapphire", "50", "70", "40", "50", "Level 16", "1"},
- {"Chimchar", "Fire", "4", "Sinnoh", "Diamond, Pearl, Platinum", "44", "58", "61", "44", "Level 14", "1"},
- {"Turtwig", "Grass", "4", "Sinnoh", "Diamond, Pearl, Platinum", "55", "68", "31", "64", "Level 18", "1"},
- {"Piplup", "Water", "4", "Sinnoh", "Diamond, Pearl, Platinum", "53", "51", "40", "53", "Level 16", "1"},
- {"Tepig", "Fire", "5", "Unova", "Black, White, Black 2, White 2", "65", "63", "45", "45", "Level 17", "1"},
- {"Snivy", "Grass", "5", "Unova", "Black, White, Black 2, White 2", "45", "45", "63", "55", "Level 17", "1"},
- {"Oshawott", "Water", "5", "Unova", "Black, White, Black 2, White 2", "55", "55", "45", "45", "Level 17", "1"},
- {"Fennekin", "Fire", "6", "Kalos", "X, Y", "40", "45", "60", "40", "Level 16", "1"},
- {"Chespin", "Grass", "6", "Kalos", "X, Y", "56", "61", "38", "65", "Level 16", "1"},
- {"Froakie", "Water", "6", "Kalos", "X, Y", "41", "56", "71", "40", "Level 16", "1"},
- };
- String[] [] secondevolutiondata = {
- {"Raichu", "Electric", "1", "Kanto", "Yellow", "60", "90", "110", "55", "Final", "2"},
- {"Charmeleon", "Fire", "1", "Kanto", "Red, Blue, Green, Fire Red, Leaf Green", "58", "64", "80", "58", "Level 36", "2"},
- {"Ivysaur", "Grass", "1", "Kanto", "Red, Blue, Green, Fire Red, Leaf Green", "60", "62", "60", "63", "Level 36", "2"},
- {"Wartortle", "Water", "2", "Kanto", "Red, Blue, Green, Fire Red, Leaf Green", "59", "63", "58", "80", "Level 36", "2"},
- {"Quilava", "Fire", "2", "Johto", "Silver, Crystal, Gold, Heart Gold, Soul Silver", "58", "64", "80", "58", "Level 36", "2"},
- {"Bayleef", "Grass", "2", "Johto", "Silver, Crystal, Gold, Heart Gold, Soul Silver", "60", "62", "60", "80", "Level 32", "2"},
- {"Croconaw", "Water", "2", "Johto", "Silver, Crystal, Gold, Heart Gold, Soul Silver", "65", "80", "58", "80", "Level 30", "2"},
- {"Combusken", "Fire", "3", "Hoenn", "Sapphire, Ruby, Emerald, Omega Ruby, Alpha Sapphire", "60", "85", "55", "60", "Level 36", "2"},
- {"Grovyle", "Grass", "3", "Hoenn", "Sapphire, Ruby, Emerald, Omega Ruby, Alpha Sapphire", "50", "65", "95", "45", "Level 36", "2"},
- {"Marshtomp", "Water", "3", "Hoenn", "Sapphire, Ruby, Emerald, Omega Ruby, Alpha Sapphire", "70", "85", "50", "70", "Level 35", "2"},
- {"Monferno", "Fire", "4", "Sinnoh", "Diamond, Pearl, Platinum", "64", "78", "81", "52", "Level 36", "2"},
- {"Grotle", "Grass", "4", "Sinnoh", "Diamond, Pearl, Platinum", "75", "89", "36", "85", "Level 32", "2"},
- {"Prinplup", "Water", "4", "Sinnoh", "Diamond, Pearl, Platinum", "64", "66", "50", "68", "Level 36", "2"},
- {"Pignite", "Fire", "5", "Unova", "Black, White, Black 2, White 2", "90", "93", "55", "55", "Level 36", "2"},
- {"Servine", "Grass", "5", "Unova", "Black, White, Black 2, White 2", "60", "60", "83", "75", "Level 36", "2"},
- {"Dewott", "Water", "5", "Unova", "Black, White, Black 2, White 2", "75", "75", "60", "60", "Level 36", "2"},
- {"Braixen", "Fire", "6", "Kalos", "X, Y", "59", "59", "73", "58", "Level 36", "2"},
- {"Quilladin", "Grass", "6", "Kalos", "X, Y", "61", "78", "57", "95", "Level 36", "2"},
- {"Froakie", "Water", "6", "Kalos", "X, Y", "41", "56", "71", "40", "Level 16", "1"},
- };
- imgcontainer = new JPanel();
- imgcontainer.setSize(1080, 500);
- int unix = 100;
- int uniy = 100;
- lab = new JLabel();
- lab.setSize(unix, uniy);
- labb = new JLabel();
- labb.setSize(unix, uniy);
- labc = new JLabel();
- labc.setSize(unix, uniy);
- labd = new JLabel();
- labd.setSize(unix, uniy);
- labe = new JLabel();
- labe.setSize(unix, uniy);
- labf = new JLabel();
- labf.setSize(unix, uniy);
- labg = new JLabel();
- labg.setSize(unix, uniy);
- labh = new JLabel();
- labh.setSize(unix, uniy);
- labi = new JLabel();
- labi.setSize(unix, uniy);
- labj = new JLabel();
- labj.setSize(unix, uniy);
- labk = new JLabel();
- labk.setSize(unix, uniy);
- labl = new JLabel();
- labl.setSize(unix, uniy);
- labm = new JLabel();
- labm.setSize(unix, uniy);
- labn = new JLabel();
- labn.setSize(unix, uniy);
- labo = new JLabel();
- labo.setSize(unix, uniy);
- labp = new JLabel();
- labp.setSize(unix, uniy);
- labq = new JLabel();
- labq.setSize(unix, uniy);
- labr = new JLabel();
- labr.setSize(unix, uniy);
- labs = new JLabel();
- labs.setSize(unix, uniy);
- System.out.println(firstevolutiondata[0][0]);
- // changeimg(pokemonname, regionname, labelname)
- changeimg(firstevolutiondata[0][0], firstevolutiondata[0][3], "1", lab);
- changeimg(firstevolutiondata[1][0], firstevolutiondata[1][3], "1", labb);
- changeimg(firstevolutiondata[2][0], firstevolutiondata[2][3], "1", labc);
- changeimg(firstevolutiondata[3][0], firstevolutiondata[3][3], "1", labd);
- changeimg(firstevolutiondata[4][0], firstevolutiondata[4][3], "1", labe);
- changeimg(firstevolutiondata[5][0], firstevolutiondata[5][3], "1", labf);
- changeimg(firstevolutiondata[6][0], firstevolutiondata[6][3], "1", labg);
- changeimg(firstevolutiondata[7][0], firstevolutiondata[7][3], "1", labh);
- changeimg(firstevolutiondata[8][0], firstevolutiondata[8][3], "1", labi);
- changeimg(firstevolutiondata[9][0], firstevolutiondata[9][3], "1", labj);
- changeimg(firstevolutiondata[10][0], firstevolutiondata[10][3], "1", labk);
- changeimg(firstevolutiondata[11][0], firstevolutiondata[11][3], "1", labl);
- changeimg(firstevolutiondata[12][0], firstevolutiondata[12][3], "1", labm);
- changeimg(firstevolutiondata[13][0], firstevolutiondata[13][3], "1", labn);
- changeimg(firstevolutiondata[14][0], firstevolutiondata[14][3], "1", labo);
- changeimg(firstevolutiondata[15][0], firstevolutiondata[15][3], "1", labp);
- changeimg(firstevolutiondata[16][0], firstevolutiondata[16][3], "1", labq);
- changeimg(firstevolutiondata[17][0], firstevolutiondata[16][3], "1", labr);
- changeimg(firstevolutiondata[18][0], firstevolutiondata[16][3], "1", labs);
- imgcontainer.add(lab); imgcontainer.add(labb); imgcontainer.add(labc); imgcontainer.add(labd); imgcontainer.add(labe); imgcontainer.add(labf); imgcontainer.add(labg); imgcontainer.add(labh); imgcontainer.add(labi); imgcontainer.add(labj); imgcontainer.add(labk); imgcontainer.add(labl); imgcontainer.add(labm); imgcontainer.add(labn); imgcontainer.add(labo); imgcontainer.add(labp); imgcontainer.add(labq); imgcontainer.add(labr); imgcontainer.add(labs);
- textArea = new JTextArea(1080, 500);
- textArea.setEditable(false);
- textArea.setLineWrap(true);
- scrollPane = new JScrollPane(textArea);
- scrollPane.setPreferredSize(new Dimension(1080, 500));
- imgScrollPane = new JScrollPane(imgcontainer);
- imgScrollPane.setPreferredSize(new Dimension(1080, 500));
- mainframe = new JFrame("Starter Pokemon Analyzer");
- mainframe.setSize(1080, 1080);
- lab.setVisible(true);
- mainframe.setVisible(true);
- mainframe.add(imgScrollPane);
- mainframe.add(scrollPane);
- mainframe.setLayout(new FlowLayout (FlowLayout.LEADING));
- String texts = "";
- // N is a value
- // X value is Row number in Data
- printstats(0, 0, texts, columnNames, firstevolutiondata);
- printstats(0, 1, texts, columnNames, firstevolutiondata);
- printstats(0, 2, texts, columnNames, firstevolutiondata);
- printstats(0, 3, texts, columnNames, firstevolutiondata);
- printstats(0, 4, texts, columnNames, firstevolutiondata);
- printstats(0, 5, texts, columnNames, firstevolutiondata);
- printstats(0, 6, texts, columnNames, firstevolutiondata);
- printstats(0, 7, texts, columnNames, firstevolutiondata);
- printstats(0, 8, texts, columnNames, firstevolutiondata);
- printstats(0, 10, texts, columnNames, firstevolutiondata);
- printstats(0, 11, texts, columnNames, firstevolutiondata);
- printstats(0, 12, texts, columnNames, firstevolutiondata);
- printstats(0, 13, texts, columnNames, firstevolutiondata);
- printstats(0, 14, texts, columnNames, firstevolutiondata);
- printstats(0, 15, texts, columnNames, firstevolutiondata);
- printstats(0, 16, texts, columnNames, firstevolutiondata);
- printstats(0, 17, texts, columnNames, firstevolutiondata);
- printstats(0, 18, texts, columnNames, firstevolutiondata);
- }
- public static void main(String[] args) {
- // TODO code application logic here
- // Starter Pokemon Data Compiler
- constructGui();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement