Advertisement
Guest User

Untitled

a guest
Feb 17th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 53.70 KB | None | 0 0
  1. package Kr;
  2.  
  3. //Author: Kapu
  4. import java.sql.Array;
  5. import java.sql.Connection;
  6. import java.sql.Date;
  7. import java.sql.DriverManager;
  8. import java.sql.ResultSet;
  9. import java.sql.Statement;
  10. import javax.swing.JOptionPane;
  11. import java.time.LocalDate;
  12. import java.time.format.DateTimeFormatter;
  13. import java.util.ArrayList;
  14. import java.util.Arrays;
  15. import javax.swing.*;
  16.  
  17. public class Main extends javax.swing.JFrame {
  18.  
  19. public Main() {
  20. initComponents();
  21. }
  22. public static int i = 0;
  23.  
  24. // DefaultListModel date, ychamp, echamp, item1, item2, item3, item4, item5, item6, kills, deaths, assists, minions, time, gold, mid = new DefaultListModel();
  25. private static String usernameA;
  26. private static String passwordA;
  27. private int counter123;
  28. private static Connection con;
  29. private static Statement st;
  30. private static ResultSet rs;
  31.  
  32. JList list;
  33. DefaultListModel uList = new DefaultListModel();
  34.  
  35. public Object test = "Tyhjä";
  36.  
  37. static ArrayList<Object> usList = new ArrayList<Object>();
  38. private static int cunter = 0;
  39. private int cunter2 = 0;
  40. // private static Object player, date, ychamp, echamp, item1, item2, item3, item4, item5, item6, kills, deaths, assists, minions, time, gold, mid;
  41. static ArrayList<Object> player2 = new ArrayList<Object>();
  42. static ArrayList<Object> date2 = new ArrayList<Object>();
  43. static ArrayList<Object> ychamp2 = new ArrayList<Object>();
  44. static ArrayList<Object> echamp2 = new ArrayList<Object>();
  45. static ArrayList<Object> item12 = new ArrayList<Object>();
  46. static ArrayList<Object> item22 = new ArrayList<Object>();
  47. static ArrayList<Object> item32 = new ArrayList<Object>();
  48. static ArrayList<Object> item42 = new ArrayList<Object>();
  49. static ArrayList<Object> item52 = new ArrayList<Object>();
  50. static ArrayList<Object> item62 = new ArrayList<Object>();
  51. static ArrayList<Object> kills2 = new ArrayList<Object>();
  52. static ArrayList<Object> assists2 = new ArrayList<Object>();
  53. static ArrayList<Object> deaths2 = new ArrayList<Object>();
  54. static ArrayList<Object> minions2 = new ArrayList<Object>();
  55. static ArrayList<Object> time2 = new ArrayList<Object>();
  56. static ArrayList<Object> gold2 = new ArrayList<Object>();
  57. static ArrayList<Object> mid2 = new ArrayList<Object>();
  58.  
  59. // , date2, ychamp2, echamp2, item12, item22, item32, item42, item52, item62, kills2, deaths2, assists2, minions2, time2, gold2, mid2 = new ArrayList<Object>();
  60. private static Object player1, date1, ychamp1, echamp1, item11, item21, item31, item41, item51, item61, kills1, deaths1, assists1, minions1, time1, gold1, mid1;
  61. static Object player, date, ychamp, echamp, item1, item2, item3, item4, item5, item6, kills, deaths, assists, minions, time, gold, mid;
  62. private static String[] testlist;
  63.  
  64. Object[] playerA, dateA, ychampA, echampA, item1A, item2A, item3A, item4A, item5A, item6A, killsA, deathsA, assistsA, minionsA, timeA, goldA, midA;
  65. Object[] usListA;
  66. ArrayList<Object> testlist1 = new ArrayList<Object>();
  67. ArrayList<String> testlist2 = new ArrayList<String>();
  68.  
  69. public static void transfer(String username, String password) {
  70. Main.usernameA = username;
  71. Main.passwordA = password;
  72. }
  73.  
  74. public static void Lista(Object username) {
  75. usList.add(username);
  76. }
  77.  
  78. class DisabledItemSelectionModel extends DefaultListSelectionModel {
  79.  
  80. @Override
  81. public void setSelectionInterval(int index0, int index1) {
  82. super.setSelectionInterval(-1, -1);
  83. }
  84. }
  85.  
  86. public static void transfertest(Object player, Object date, Object ychamp, Object echamp, Object item1, Object item2, Object item3, Object item4, Object item5, Object item6, Object kills, Object deaths, Object assists, Object farm, Object time, Object gold, Object mid, int counter) {
  87. //Käytä suoraan Object -> Getlist
  88.  
  89. player2.add(player);
  90. date2.add(date);
  91. ychamp2.add(ychamp);
  92. echamp2.add(echamp);
  93. item12.add(item1);
  94. item22.add(item2);
  95. item32.add(item3);
  96. item42.add(item4);
  97. item52.add(item5);
  98. item62.add(item6);
  99. kills2.add(kills);
  100. deaths2.add(deaths);
  101. assists2.add(assists);
  102. minions2.add(minions);
  103. time2.add(time);
  104. gold2.add(gold);
  105. mid2.add(mid);
  106. Main.cunter = counter;
  107. }
  108.  
  109. @SuppressWarnings("unchecked")
  110. // <editor-fold defaultstate="collapsed" desc="Generated Code">
  111. private void initComponents() {
  112.  
  113. jFill = new javax.swing.JDialog();
  114. jButton4 = new javax.swing.JButton();
  115. jScrollPane1 = new javax.swing.JScrollPane();
  116. jList1 = new javax.swing.JList<>();
  117. jLabel7 = new javax.swing.JLabel();
  118. jLabel8 = new javax.swing.JLabel();
  119. jScrollPane3 = new javax.swing.JScrollPane();
  120. jList2 = new javax.swing.JList<>();
  121. Date = new javax.swing.JTextField();
  122. jLabel5 = new javax.swing.JLabel();
  123. jLabel6 = new javax.swing.JLabel();
  124. Kills = new javax.swing.JTextField();
  125. jLabel9 = new javax.swing.JLabel();
  126. Death = new javax.swing.JTextField();
  127. jLabel10 = new javax.swing.JLabel();
  128. Assist = new javax.swing.JTextField();
  129. jLabel12 = new javax.swing.JLabel();
  130. jLabel13 = new javax.swing.JLabel();
  131. jLabel18 = new javax.swing.JLabel();
  132. jLabel14 = new javax.swing.JLabel();
  133. jLabel15 = new javax.swing.JLabel();
  134. Gold = new javax.swing.JTextField();
  135. jLabel16 = new javax.swing.JLabel();
  136. GameTime = new javax.swing.JTextField();
  137. jLabel17 = new javax.swing.JLabel();
  138. jLabel11 = new javax.swing.JLabel();
  139. Item5 = new javax.swing.JTextField();
  140. Item3 = new javax.swing.JTextField();
  141. Item2 = new javax.swing.JTextField();
  142. Item1 = new javax.swing.JTextField();
  143. Item4 = new javax.swing.JTextField();
  144. Item6 = new javax.swing.JTextField();
  145. jLabel19 = new javax.swing.JLabel();
  146. Farmi = new javax.swing.JTextField();
  147. jLabel20 = new javax.swing.JLabel();
  148. jRadioButton1 = new javax.swing.JRadioButton();
  149. jRadioButton2 = new javax.swing.JRadioButton();
  150. jSearch = new javax.swing.JDialog();
  151. jScrollPane4 = new javax.swing.JScrollPane();
  152. jTextArea2 = new javax.swing.JTextArea();
  153. jScrollPane5 = new javax.swing.JScrollPane();
  154. TestiLista = new javax.swing.JList(new DefaultListModel());
  155. jLabel21 = new javax.swing.JLabel();
  156. searchField = new javax.swing.JTextField();
  157. jButton5 = new javax.swing.JButton();
  158. jLabel23 = new javax.swing.JLabel();
  159. jRegister = new javax.swing.JDialog();
  160. jTextField1 = new javax.swing.JTextField();
  161. jLabel3 = new javax.swing.JLabel();
  162. jLabel4 = new javax.swing.JLabel();
  163. jButton3 = new javax.swing.JButton();
  164. jPasswordField1 = new javax.swing.JPasswordField();
  165. buttonGroup1 = new javax.swing.ButtonGroup();
  166. jUsername = new javax.swing.JTextField();
  167. jLabel1 = new javax.swing.JLabel();
  168. jLabel2 = new javax.swing.JLabel();
  169. jButton1 = new javax.swing.JButton();
  170. jButton2 = new javax.swing.JButton();
  171. jPasswordField2 = new javax.swing.JPasswordField();
  172. jMenuBar1 = new javax.swing.JMenuBar();
  173. changeButton = new javax.swing.JMenu();
  174. jMenuItem1 = new javax.swing.JMenuItem();
  175. jMenuItem2 = new javax.swing.JMenuItem();
  176. jMenuItem3 = new javax.swing.JMenuItem();
  177.  
  178. jFill.setTitle("League Data Fill");
  179. jFill.setResizable(false);
  180.  
  181. jButton4.setText("Ok");
  182. jButton4.addActionListener(new java.awt.event.ActionListener() {
  183. public void actionPerformed(java.awt.event.ActionEvent evt) {
  184. jButton4ActionPerformed(evt);
  185. }
  186. });
  187.  
  188. jList1.setModel(new javax.swing.AbstractListModel<String>() {
  189. String[] strings = { "Aatrox", "Ahri", "Akali", "Alistar", "Amumu", "Anivia", "Annie", "Ashe", "Aurelion Sol", "Azir", "Bard", "Blitzcrank", "Brand", "Braum", "Caitlyn", "Camille", "Cassiopeia", "Cho'Gath", "Corki", "Darius", "Diana", "Dr. Mundo", "Draven", "Ekko", "Elise", "Evelynn", "Ezreal", "Fiddlesticks", "Fiora", "Fizz", "Galio", "Gangplank", "Garen", "Gnar", "Gragas", "Graves", "Hecarim", "Heimerdinger", "Illaoi", "Irelia", "Ivern", "Janna", "Jarvan IV", "Jax", "Jayce", "Jhin", "Jinx", "Kalista", "Karma", "Karthus", "Kassadin", "Katarina", "Kayle", "Kennen", "Kha'Zix", "Kindred", "Kled", "Kog'Maw", "LeBlanc", "Lee Sin", "Leona", "Lissandra", "Lucian", "Lulu", "Lux", "Malphite", "Malzahar", "Maokai", "Master Yi", "Miss Fortune", "Morderkaiser", "Morgana", "Nami", "Nasus", "Nautilus", "Nidalee", "Nocturne", "Nunu", "Olaf", "Orianna", "Pantheon", "Poppy", "Quinn", "Rammus", "Rek'Sai", "Renekton", "Rengar", "Riven", "Rumble", "Ryze", "Sejuani", "Shaco", "Shen", "Shyvana", "Singed", "Sion", "Sivir", "Skarner", "Sona", "Soraka", "Swain", "Syndra", "Tahm Kench", "Taliyah", "Talon", "Taric", "Teemo", "Thresh", "Tristana", "Trundle", "Tryndamere", "Twisted Fate", "Twitch", "Udyr", "Urgot", "Varus", "Vayne", "Veigar", "Vel'Koz", "Vi", "Viktor", "Vladimir", "Volibear", "Warwick", "Wukong", "Xerath", "Xin Zhao", "Yasuo", "Yorick", "Zac", "Zed", "Ziggs", "Zilean", "Zyra" };
  190. public int getSize() { return strings.length; }
  191. public String getElementAt(int i) { return strings[i]; }
  192. });
  193. jScrollPane1.setViewportView(jList1);
  194.  
  195. jLabel7.setText("Champion list");
  196.  
  197. jLabel8.setText("Enemy Champion");
  198.  
  199. jList2.setModel(new javax.swing.AbstractListModel<String>() {
  200. String[] strings = { "Aatrox", "Ahri", "Akali", "Alistar", "Amumu", "Anivia", "Annie", "Ashe", "Aurelion Sol", "Azir", "Bard", "Blitzcrank", "Brand", "Braum", "Caitlyn", "Camille", "Cassiopeia", "Cho'Gath", "Corki", "Darius", "Diana", "Dr. Mundo", "Draven", "Ekko", "Elise", "Evelynn", "Ezreal", "Fiddlesticks", "Fiora", "Fizz", "Galio", "Gangplank", "Garen", "Gnar", "Gragas", "Graves", "Hecarim", "Heimerdinger", "Illaoi", "Irelia", "Ivern", "Janna", "Jarvan IV", "Jax", "Jayce", "Jhin", "Jinx", "Kalista", "Karma", "Karthus", "Kassadin", "Katarina", "Kayle", "Kennen", "Kha'Zix", "Kindred", "Kled", "Kog'Maw", "LeBlanc", "Lee Sin", "Leona", "Lissandra", "Lucian", "Lulu", "Lux", "Malphite", "Malzahar", "Maokai", "Master Yi", "Miss Fortune", "Morderkaiser", "Morgana", "Nami", "Nasus", "Nautilus", "Nidalee", "Nocturne", "Nunu", "Olaf", "Orianna", "Pantheon", "Poppy", "Quinn", "Rammus", "Rek'Sai", "Renekton", "Rengar", "Riven", "Rumble", "Ryze", "Sejuani", "Shaco", "Shen", "Shyvana", "Singed", "Sion", "Sivir", "Skarner", "Sona", "Soraka", "Swain", "Syndra", "Tahm Kench", "Taliyah", "Talon", "Taric", "Teemo", "Thresh", "Tristana", "Trundle", "Tryndamere", "Twisted Fate", "Twitch", "Udyr", "Urgot", "Varus", "Vayne", "Veigar", "Vel'Koz", "Vi", "Viktor", "Vladimir", "Volibear", "Warwick", "Wukong", "Xerath", "Xin Zhao", "Yasuo", "Yorick", "Zac", "Zed", "Ziggs", "Zilean", "Zyra" };
  201. public int getSize() { return strings.length; }
  202. public String getElementAt(int i) { return strings[i]; }
  203. });
  204. jScrollPane3.setViewportView(jList2);
  205.  
  206. Date.setToolTipText("Use Days/Month/Year with two numbers per field format(01/01/1999)");
  207.  
  208. jLabel5.setText("Date:");
  209.  
  210. jLabel6.setText("Kills");
  211.  
  212. Kills.addActionListener(new java.awt.event.ActionListener() {
  213. public void actionPerformed(java.awt.event.ActionEvent evt) {
  214. KillsActionPerformed(evt);
  215. }
  216. });
  217.  
  218. jLabel9.setText("Deaths");
  219.  
  220. Death.addActionListener(new java.awt.event.ActionListener() {
  221. public void actionPerformed(java.awt.event.ActionEvent evt) {
  222. DeathActionPerformed(evt);
  223. }
  224. });
  225.  
  226. jLabel10.setText("Assists");
  227.  
  228. Assist.addActionListener(new java.awt.event.ActionListener() {
  229. public void actionPerformed(java.awt.event.ActionEvent evt) {
  230. AssistActionPerformed(evt);
  231. }
  232. });
  233.  
  234. jLabel12.setText("Total Gold");
  235.  
  236. jLabel13.setText("Item 1");
  237.  
  238. jLabel18.setText("Item 6");
  239.  
  240. jLabel14.setText("Item 2");
  241.  
  242. jLabel15.setText("Item 3");
  243.  
  244. Gold.addActionListener(new java.awt.event.ActionListener() {
  245. public void actionPerformed(java.awt.event.ActionEvent evt) {
  246. GoldActionPerformed(evt);
  247. }
  248. });
  249.  
  250. jLabel16.setText("Item 4");
  251.  
  252. GameTime.setToolTipText("Use , between minutes and seconds (Example: 23,11)");
  253. GameTime.addActionListener(new java.awt.event.ActionListener() {
  254. public void actionPerformed(java.awt.event.ActionEvent evt) {
  255. GameTimeActionPerformed(evt);
  256. }
  257. });
  258.  
  259. jLabel17.setText("Item 5");
  260.  
  261. jLabel11.setText("Game Time");
  262.  
  263. Item5.setText("Empty");
  264. Item5.addActionListener(new java.awt.event.ActionListener() {
  265. public void actionPerformed(java.awt.event.ActionEvent evt) {
  266. Item5ActionPerformed(evt);
  267. }
  268. });
  269.  
  270. Item3.setText("Empty");
  271. Item3.addActionListener(new java.awt.event.ActionListener() {
  272. public void actionPerformed(java.awt.event.ActionEvent evt) {
  273. Item3ActionPerformed(evt);
  274. }
  275. });
  276.  
  277. Item2.setText("Empty");
  278. Item2.addActionListener(new java.awt.event.ActionListener() {
  279. public void actionPerformed(java.awt.event.ActionEvent evt) {
  280. Item2ActionPerformed(evt);
  281. }
  282. });
  283.  
  284. Item1.setText("Empty");
  285. Item1.addActionListener(new java.awt.event.ActionListener() {
  286. public void actionPerformed(java.awt.event.ActionEvent evt) {
  287. Item1ActionPerformed(evt);
  288. }
  289. });
  290.  
  291. Item4.setText("Empty");
  292. Item4.addActionListener(new java.awt.event.ActionListener() {
  293. public void actionPerformed(java.awt.event.ActionEvent evt) {
  294. Item4ActionPerformed(evt);
  295. }
  296. });
  297.  
  298. Item6.setText("Empty");
  299. Item6.addActionListener(new java.awt.event.ActionListener() {
  300. public void actionPerformed(java.awt.event.ActionEvent evt) {
  301. Item6ActionPerformed(evt);
  302. }
  303. });
  304.  
  305. jLabel19.setText("Farm");
  306.  
  307. jLabel20.setText("Did you run it down mid?");
  308.  
  309. buttonGroup1.add(jRadioButton1);
  310. jRadioButton1.setText("Yes");
  311. jRadioButton1.addActionListener(new java.awt.event.ActionListener() {
  312. public void actionPerformed(java.awt.event.ActionEvent evt) {
  313. jRadioButton1ActionPerformed(evt);
  314. }
  315. });
  316.  
  317. buttonGroup1.add(jRadioButton2);
  318. jRadioButton2.setText("No");
  319.  
  320. javax.swing.GroupLayout jFillLayout = new javax.swing.GroupLayout(jFill.getContentPane());
  321. jFill.getContentPane().setLayout(jFillLayout);
  322. jFillLayout.setHorizontalGroup(
  323. jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  324. .addGroup(jFillLayout.createSequentialGroup()
  325. .addContainerGap()
  326. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  327. .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
  328. .addComponent(jLabel7)
  329. .addGroup(jFillLayout.createSequentialGroup()
  330. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  331. .addComponent(jLabel11)
  332. .addComponent(jLabel19))
  333. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  334. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  335. .addComponent(GameTime, javax.swing.GroupLayout.DEFAULT_SIZE, 60, Short.MAX_VALUE)
  336. .addComponent(Farmi))))
  337. .addGap(27, 27, 27)
  338. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  339. .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
  340. .addComponent(jLabel8)
  341. .addGroup(jFillLayout.createSequentialGroup()
  342. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  343. .addComponent(jLabel5)
  344. .addComponent(jLabel12))
  345. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  346. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  347. .addComponent(Date, javax.swing.GroupLayout.DEFAULT_SIZE, 75, Short.MAX_VALUE)
  348. .addComponent(Gold))))
  349. .addGap(42, 42, 42)
  350. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  351. .addGroup(jFillLayout.createSequentialGroup()
  352. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  353. .addGroup(jFillLayout.createSequentialGroup()
  354. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  355. .addComponent(jLabel13)
  356. .addComponent(jLabel16))
  357. .addGap(62, 62, 62))
  358. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jFillLayout.createSequentialGroup()
  359. .addComponent(Item4, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
  360. .addGap(18, 18, 18)))
  361. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  362. .addGroup(jFillLayout.createSequentialGroup()
  363. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  364. .addComponent(jLabel14)
  365. .addComponent(jLabel17))
  366. .addGap(60, 60, 60)
  367. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  368. .addComponent(jLabel15)
  369. .addComponent(jLabel18))
  370. .addGap(0, 0, Short.MAX_VALUE))
  371. .addGroup(jFillLayout.createSequentialGroup()
  372. .addComponent(Item5, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
  373. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  374. .addComponent(Item6, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))))
  375. .addGroup(jFillLayout.createSequentialGroup()
  376. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  377. .addGroup(jFillLayout.createSequentialGroup()
  378. .addComponent(jLabel20)
  379. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  380. .addComponent(jRadioButton1)
  381. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  382. .addComponent(jRadioButton2))
  383. .addGroup(jFillLayout.createSequentialGroup()
  384. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  385. .addComponent(jLabel6)
  386. .addComponent(Kills, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))
  387. .addGap(40, 40, 40)
  388. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  389. .addComponent(jLabel9)
  390. .addComponent(Death, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))
  391. .addGap(31, 31, 31)
  392. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  393. .addComponent(jLabel10)
  394. .addComponent(Assist, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)))
  395. .addGroup(jFillLayout.createSequentialGroup()
  396. .addComponent(Item1, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
  397. .addGap(18, 18, 18)
  398. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  399. .addGroup(jFillLayout.createSequentialGroup()
  400. .addGap(112, 112, 112)
  401. .addComponent(jButton4))
  402. .addGroup(jFillLayout.createSequentialGroup()
  403. .addComponent(Item2, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
  404. .addGap(18, 18, 18)
  405. .addComponent(Item3, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)))))
  406. .addGap(0, 0, Short.MAX_VALUE)))
  407. .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  408. );
  409. jFillLayout.setVerticalGroup(
  410. jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  411. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jFillLayout.createSequentialGroup()
  412. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  413. .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jFillLayout.createSequentialGroup()
  414. .addContainerGap()
  415. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  416. .addComponent(jLabel6)
  417. .addComponent(jLabel9)
  418. .addComponent(jLabel10))
  419. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  420. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  421. .addComponent(Kills, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  422. .addComponent(Death, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  423. .addComponent(Assist, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  424. .addGap(18, 18, 18)
  425. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  426. .addComponent(jLabel13)
  427. .addComponent(jLabel14)
  428. .addComponent(jLabel15))
  429. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  430. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  431. .addComponent(Item3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  432. .addComponent(Item2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  433. .addComponent(Item1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  434. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  435. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  436. .addComponent(jLabel16)
  437. .addComponent(jLabel17)
  438. .addComponent(jLabel18))
  439. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  440. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  441. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  442. .addComponent(Item5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  443. .addComponent(Item6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  444. .addComponent(Item4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
  445. .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jFillLayout.createSequentialGroup()
  446. .addGap(22, 22, 22)
  447. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  448. .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.TRAILING)
  449. .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.TRAILING))
  450. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  451. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  452. .addComponent(jScrollPane1)
  453. .addComponent(jScrollPane3))
  454. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  455. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  456. .addComponent(GameTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  457. .addComponent(Gold, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  458. .addComponent(jLabel12)
  459. .addComponent(jLabel11)
  460. .addComponent(jLabel20)
  461. .addComponent(jRadioButton1)
  462. .addComponent(jRadioButton2))))
  463. .addGap(18, 18, 18)
  464. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  465. .addComponent(jButton4)
  466. .addGroup(jFillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  467. .addComponent(jLabel19)
  468. .addComponent(Farmi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  469. .addComponent(jLabel5)
  470. .addComponent(Date, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
  471. .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  472. );
  473.  
  474. jSearch.addWindowStateListener(new java.awt.event.WindowStateListener() {
  475. public void windowStateChanged(java.awt.event.WindowEvent evt) {
  476. jSearchWindowStateChanged(evt);
  477. }
  478. });
  479.  
  480. jTextArea2.setEditable(false);
  481. jTextArea2.setColumns(20);
  482. jTextArea2.setRows(5);
  483. jScrollPane4.setViewportView(jTextArea2);
  484.  
  485. TestiLista.setSelectionModel(new DisabledItemSelectionModel());
  486. jScrollPane5.setViewportView(TestiLista);
  487.  
  488. jLabel21.setText("Username");
  489.  
  490. jButton5.setText("Search");
  491. jButton5.addActionListener(new java.awt.event.ActionListener() {
  492. public void actionPerformed(java.awt.event.ActionEvent evt) {
  493. jButton5ActionPerformed(evt);
  494. }
  495. });
  496.  
  497. jLabel23.setText("Userlist");
  498.  
  499. javax.swing.GroupLayout jSearchLayout = new javax.swing.GroupLayout(jSearch.getContentPane());
  500. jSearch.getContentPane().setLayout(jSearchLayout);
  501. jSearchLayout.setHorizontalGroup(
  502. jSearchLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  503. .addGroup(jSearchLayout.createSequentialGroup()
  504. .addContainerGap()
  505. .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 335, javax.swing.GroupLayout.PREFERRED_SIZE)
  506. .addGap(18, 18, 18)
  507. .addGroup(jSearchLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  508. .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  509. .addGroup(jSearchLayout.createSequentialGroup()
  510. .addComponent(jLabel21)
  511. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  512. .addComponent(searchField))
  513. .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
  514. .addGroup(jSearchLayout.createSequentialGroup()
  515. .addGap(39, 39, 39)
  516. .addComponent(jLabel23)
  517. .addGap(0, 50, Short.MAX_VALUE)))
  518. .addContainerGap())
  519. );
  520. jSearchLayout.setVerticalGroup(
  521. jSearchLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  522. .addGroup(jSearchLayout.createSequentialGroup()
  523. .addContainerGap()
  524. .addGroup(jSearchLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  525. .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
  526. .addGroup(jSearchLayout.createSequentialGroup()
  527. .addComponent(jLabel23)
  528. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  529. .addComponent(jScrollPane5)
  530. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  531. .addGroup(jSearchLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  532. .addComponent(jLabel21)
  533. .addComponent(searchField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  534. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  535. .addComponent(jButton5)))
  536. .addContainerGap())
  537. );
  538.  
  539. jTextField1.addActionListener(new java.awt.event.ActionListener() {
  540. public void actionPerformed(java.awt.event.ActionEvent evt) {
  541. jTextField1ActionPerformed(evt);
  542. }
  543. });
  544.  
  545. jLabel3.setText("Please enter username:");
  546.  
  547. jLabel4.setText("Please enter password:");
  548.  
  549. jButton3.setText("Register");
  550. jButton3.addActionListener(new java.awt.event.ActionListener() {
  551. public void actionPerformed(java.awt.event.ActionEvent evt) {
  552. jButton3ActionPerformed(evt);
  553. }
  554. });
  555.  
  556. javax.swing.GroupLayout jRegisterLayout = new javax.swing.GroupLayout(jRegister.getContentPane());
  557. jRegister.getContentPane().setLayout(jRegisterLayout);
  558. jRegisterLayout.setHorizontalGroup(
  559. jRegisterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  560. .addGroup(jRegisterLayout.createSequentialGroup()
  561. .addContainerGap()
  562. .addGroup(jRegisterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  563. .addGroup(jRegisterLayout.createSequentialGroup()
  564. .addGroup(jRegisterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  565. .addComponent(jLabel3)
  566. .addComponent(jLabel4))
  567. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  568. .addGroup(jRegisterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  569. .addComponent(jTextField1)
  570. .addComponent(jPasswordField1, javax.swing.GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE)))
  571. .addComponent(jButton3))
  572. .addContainerGap(73, Short.MAX_VALUE))
  573. );
  574. jRegisterLayout.setVerticalGroup(
  575. jRegisterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  576. .addGroup(jRegisterLayout.createSequentialGroup()
  577. .addGap(26, 26, 26)
  578. .addGroup(jRegisterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  579. .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  580. .addComponent(jLabel3))
  581. .addGap(26, 26, 26)
  582. .addGroup(jRegisterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  583. .addComponent(jLabel4)
  584. .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  585. .addGap(18, 18, 18)
  586. .addComponent(jButton3)
  587. .addContainerGap(41, Short.MAX_VALUE))
  588. );
  589.  
  590. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  591. setTitle("League Diary");
  592.  
  593. jUsername.addActionListener(new java.awt.event.ActionListener() {
  594. public void actionPerformed(java.awt.event.ActionEvent evt) {
  595. jUsernameActionPerformed(evt);
  596. }
  597. });
  598.  
  599. jLabel1.setText("Username");
  600.  
  601. jLabel2.setText("Password");
  602.  
  603. jButton1.setText("Login");
  604. jButton1.addActionListener(new java.awt.event.ActionListener() {
  605. public void actionPerformed(java.awt.event.ActionEvent evt) {
  606. jButton1ActionPerformed(evt);
  607. }
  608. });
  609. jButton1.addKeyListener(new java.awt.event.KeyAdapter() {
  610. public void keyPressed(java.awt.event.KeyEvent evt) {
  611. jButton1KeyPressed(evt);
  612. }
  613. });
  614.  
  615. jButton2.setText("Register");
  616. jButton2.addActionListener(new java.awt.event.ActionListener() {
  617. public void actionPerformed(java.awt.event.ActionEvent evt) {
  618. jButton2ActionPerformed(evt);
  619. }
  620. });
  621.  
  622. changeButton.setText("Menu");
  623. changeButton.setToolTipText("");
  624. changeButton.addActionListener(new java.awt.event.ActionListener() {
  625. public void actionPerformed(java.awt.event.ActionEvent evt) {
  626. changeButtonActionPerformed(evt);
  627. }
  628. });
  629.  
  630. jMenuItem1.setText("Fill");
  631. jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
  632. public void actionPerformed(java.awt.event.ActionEvent evt) {
  633. jMenuItem1ActionPerformed(evt);
  634. }
  635. });
  636. changeButton.add(jMenuItem1);
  637.  
  638. jMenuItem2.setText("Search");
  639. jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
  640. public void actionPerformed(java.awt.event.ActionEvent evt) {
  641. jMenuItem2ActionPerformed(evt);
  642. }
  643. });
  644. changeButton.add(jMenuItem2);
  645.  
  646. jMenuItem3.setText("Log out");
  647. jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
  648. public void actionPerformed(java.awt.event.ActionEvent evt) {
  649. jMenuItem3ActionPerformed(evt);
  650. }
  651. });
  652. changeButton.add(jMenuItem3);
  653.  
  654. jMenuBar1.add(changeButton);
  655.  
  656. setJMenuBar(jMenuBar1);
  657.  
  658. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  659. getContentPane().setLayout(layout);
  660. layout.setHorizontalGroup(
  661. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  662. .addGroup(layout.createSequentialGroup()
  663. .addGap(122, 122, 122)
  664. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  665. .addGroup(layout.createSequentialGroup()
  666. .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
  667. .addGap(25, 25, 25)
  668. .addComponent(jButton2))
  669. .addComponent(jLabel2)
  670. .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
  671. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
  672. .addComponent(jPasswordField2, javax.swing.GroupLayout.Alignment.LEADING)
  673. .addComponent(jUsername, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)))
  674. .addContainerGap(110, Short.MAX_VALUE))
  675. );
  676. layout.setVerticalGroup(
  677. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  678. .addGroup(layout.createSequentialGroup()
  679. .addGap(58, 58, 58)
  680. .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
  681. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  682. .addComponent(jUsername, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  683. .addGap(18, 18, 18)
  684. .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
  685. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  686. .addComponent(jPasswordField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  687. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 91, Short.MAX_VALUE)
  688. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  689. .addComponent(jButton1)
  690. .addComponent(jButton2))
  691. .addGap(34, 34, 34))
  692. );
  693.  
  694. pack();
  695. }// </editor-fold>
  696.  
  697. private void jUsernameActionPerformed(java.awt.event.ActionEvent evt) {
  698. // TODO add your handling code here:
  699. }
  700.  
  701. private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
  702. //Login button
  703.  
  704. DBConnect connect = new DBConnect();
  705.  
  706. String username1 = jUsername.getText().toLowerCase();
  707. String password1 = String.valueOf(jPasswordField2.getPassword());
  708.  
  709. connect.checkLogin(username1, password1);
  710.  
  711. if (username1.equals(usernameA) && password1.equals(passwordA)) {
  712. JOptionPane.showMessageDialog(null, "Welcome back " + username1);
  713. jUsername.setVisible(false);
  714. jPasswordField2.setVisible(false);
  715. jButton1.setVisible(false);
  716. jLabel1.setVisible(false);
  717. jLabel2.setVisible(false);
  718. jButton2.setVisible(false);
  719.  
  720. connect.getUserList();
  721.  
  722. usListA = usList.toArray();
  723. for (i = 0; i < usListA.length; i++) {
  724. ((DefaultListModel) TestiLista.getModel()).addElement(usListA[i]);;
  725. }
  726.  
  727. jMenuBar1.setVisible(true);
  728. } else {
  729. if (username1.equals(usernameA) && !password1.equals(passwordA)) {
  730. JOptionPane.showMessageDialog(null, "Password is wrong, please try again");
  731. } else if (!username1.equals(usernameA) && password1.equals(passwordA)) {
  732. JOptionPane.showMessageDialog(null, "Username is wrong, please try again");
  733. } else if (!username1.equals(usernameA) && !password1.equals(passwordA)) {
  734. JOptionPane.showMessageDialog(null, "Username and password are wrong, please try again");
  735. }
  736. }
  737. }
  738.  
  739.  
  740. private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
  741. //Fill Dialog
  742. jFill.setSize(650, 325);
  743. jFill.setVisible(true);
  744.  
  745. }
  746.  
  747. private void jButton1KeyPressed(java.awt.event.KeyEvent evt) {
  748.  
  749. }
  750.  
  751. private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
  752. //Register
  753. jRegister.setSize(347, 200);
  754. jRegister.setVisible(true);
  755.  
  756. }
  757.  
  758. private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
  759. // TODO add your handling code here:
  760. }
  761.  
  762. private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
  763. //Register Confirm
  764. DBConnect connect = new DBConnect();
  765.  
  766. String rName = jTextField1.getText().toLowerCase();
  767. String rPassword = String.valueOf(jPasswordField1.getPassword());
  768.  
  769. connect.giveRegister(rName, rPassword);
  770.  
  771. jTextField1.setText("");
  772. jPasswordField1.setText("");
  773.  
  774. jRegister.setVisible(false);
  775. }
  776.  
  777. private void changeButtonActionPerformed(java.awt.event.ActionEvent evt) {
  778.  
  779. }
  780.  
  781. private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {
  782. JOptionPane.showMessageDialog(null, "You have successfully logged out");
  783. jUsername.setVisible(true);
  784. jUsername.setText("");
  785. jPasswordField2.setVisible(true);
  786. jPasswordField2.setText("");
  787. jButton1.setVisible(true);
  788. jLabel1.setVisible(true);
  789. jLabel2.setVisible(true);
  790. jButton2.setVisible(true);
  791.  
  792. jMenuBar1.setVisible(false);
  793. }
  794.  
  795. private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
  796. //FillOKButton
  797. DBConnect connect = new DBConnect();
  798.  
  799. String player = usernameA;
  800.  
  801. String date = Date.getText();
  802. DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy");
  803. LocalDate localDate = LocalDate.parse(date, formatter);
  804. java.sql.Date date2 = java.sql.Date.valueOf(localDate);
  805.  
  806. String ychamp = jList1.getSelectedValue();
  807. String echamp = jList2.getSelectedValue();
  808. String item1 = Item1.getText();
  809. String item2 = Item2.getText();
  810. String item3 = Item3.getText();
  811. String item4 = Item4.getText();
  812. String item5 = Item5.getText();
  813. String item6 = Item6.getText();
  814. String kills = Kills.getText();
  815. String deaths = Death.getText();
  816. String assists = Assist.getText();
  817. String farmi = Farmi.getText();
  818. String time = GameTime.getText();
  819. String gold = Gold.getText();
  820. String mid = null;
  821. if (jRadioButton1.isSelected()) {
  822. mid = jRadioButton1.getText();
  823. } else if (jRadioButton2.isSelected()) {
  824. mid = jRadioButton2.getText();
  825. }
  826. connect.matchInfo(player, date2, ychamp, echamp, item1, item2, item3, item4, item5, item6, kills, deaths, assists, farmi, time, gold, mid);
  827.  
  828. Item1.setText("Empty");
  829. Item2.setText("Empty");
  830. Item3.setText("Empty");
  831. Item4.setText("Empty");
  832. Item5.setText("Empty");
  833. Item6.setText("Empty");
  834. Date.setText("");
  835. Kills.setText("");
  836. Assist.setText("");
  837. Death.setText("");
  838. Farmi.setText("");
  839. GameTime.setText("");
  840. Gold.setText("");
  841. jRadioButton1.setSelected(false);
  842. jRadioButton2.setSelected(false);
  843. jList1.clearSelection();
  844. jList2.clearSelection();
  845.  
  846. jFill.setVisible(false);
  847. }
  848.  
  849. private void DeathActionPerformed(java.awt.event.ActionEvent evt) {
  850. // TODO add your handling code here:
  851. }
  852.  
  853. private void KillsActionPerformed(java.awt.event.ActionEvent evt) {
  854. // TODO add your handling code here:
  855. }
  856.  
  857. private void AssistActionPerformed(java.awt.event.ActionEvent evt) {
  858. // TODO add your handling code here:
  859. }
  860.  
  861. private void GoldActionPerformed(java.awt.event.ActionEvent evt) {
  862. // TODO add your handling code here:
  863. }
  864.  
  865. private void GameTimeActionPerformed(java.awt.event.ActionEvent evt) {
  866. // TODO add your handling code here:
  867. }
  868.  
  869. private void Item5ActionPerformed(java.awt.event.ActionEvent evt) {
  870. // TODO add your handling code here:
  871. }
  872.  
  873. private void Item3ActionPerformed(java.awt.event.ActionEvent evt) {
  874. // TODO add your handling code here:
  875. }
  876.  
  877. private void Item2ActionPerformed(java.awt.event.ActionEvent evt) {
  878. // TODO add your handling code here:
  879. }
  880.  
  881. private void Item1ActionPerformed(java.awt.event.ActionEvent evt) {
  882. // TODO add your handling code here:
  883. }
  884.  
  885. private void Item4ActionPerformed(java.awt.event.ActionEvent evt) {
  886. // TODO add your handling code here:
  887. }
  888.  
  889. private void Item6ActionPerformed(java.awt.event.ActionEvent evt) {
  890. // TODO add your handling code here:
  891. }
  892.  
  893. private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {
  894. // TODO add your handling code here:
  895. }
  896.  
  897. private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {
  898. //SearchWinodwutton
  899.  
  900. TestiLista.removeAll();
  901. jSearch.setSize(510, 325);
  902.  
  903. jSearch.setVisible(true);
  904.  
  905.  
  906. }
  907.  
  908. private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
  909. //Search button
  910. jTextArea2.setText("");
  911. DBConnect connect = new DBConnect();
  912.  
  913. connect.getInfo(searchField.getText());
  914.  
  915. playerA = player2.toArray();
  916. dateA = date2.toArray();
  917. ychampA = ychamp2.toArray();
  918. echampA = echamp2.toArray();
  919. item1A = item12.toArray();
  920. item2A = item22.toArray();
  921. item3A = item32.toArray();
  922. item4A = item42.toArray();
  923. item5A = item52.toArray();
  924. item6A = item62.toArray();
  925. killsA = kills2.toArray();
  926. deathsA = deaths2.toArray();
  927. assistsA = assists2.toArray();
  928. minionsA = minions2.toArray();
  929. timeA = time2.toArray();
  930. goldA = gold2.toArray();
  931. midA = mid2.toArray();
  932.  
  933. while (cunter2 != cunter) {
  934.  
  935. jTextArea2.setText(jTextArea2.getText() + "\n Date:" + dateA[cunter2] + " \n You played: " + ychampA[cunter2] + "\n Enemy played: " + echampA[cunter2] + "\n You bought: " + item1A[cunter2] + ", " + item2A[cunter2] + ", " + item3A[cunter2] + ", " + item4A[cunter2] + ", " + item5A[cunter2] + ", " + item6A[cunter2] + "\n Your KDA was " + killsA[cunter2] + "/" + deathsA[cunter2] + "/" + assistsA[cunter2] + "\n You got " + minionsA[cunter2] + " minions \n The game took " + timeA[cunter2] + "minutes \n You earned " + goldA[cunter2] + " gold \n Also did you run it down mid lad? " + midA[cunter2] + "\n");
  936. cunter2++;
  937. }
  938. }
  939.  
  940. private void jSearchWindowStateChanged(java.awt.event.WindowEvent evt) {
  941.  
  942. }
  943. public static void main(String args[]) {
  944.  
  945. java.awt.EventQueue.invokeLater(new Runnable() {
  946. public void run() {
  947.  
  948. new Main().setVisible(true);
  949. jMenuBar1.setVisible(false);
  950.  
  951. }
  952. });
  953. }
  954. // Variables declaration - do not modify
  955. private javax.swing.JTextField Assist;
  956. private javax.swing.JTextField Date;
  957. private javax.swing.JTextField Death;
  958. private javax.swing.JTextField Farmi;
  959. private javax.swing.JTextField GameTime;
  960. private javax.swing.JTextField Gold;
  961. private javax.swing.JTextField Item1;
  962. private javax.swing.JTextField Item2;
  963. private javax.swing.JTextField Item3;
  964. private javax.swing.JTextField Item4;
  965. private javax.swing.JTextField Item5;
  966. private javax.swing.JTextField Item6;
  967. private javax.swing.JTextField Kills;
  968. private static javax.swing.JList<String> TestiLista;
  969. private javax.swing.ButtonGroup buttonGroup1;
  970. private javax.swing.JMenu changeButton;
  971. private javax.swing.JButton jButton1;
  972. private javax.swing.JButton jButton2;
  973. private javax.swing.JButton jButton3;
  974. private javax.swing.JButton jButton4;
  975. private javax.swing.JButton jButton5;
  976. private javax.swing.JDialog jFill;
  977. private javax.swing.JLabel jLabel1;
  978. private javax.swing.JLabel jLabel10;
  979. private javax.swing.JLabel jLabel11;
  980. private javax.swing.JLabel jLabel12;
  981. private javax.swing.JLabel jLabel13;
  982. private javax.swing.JLabel jLabel14;
  983. private javax.swing.JLabel jLabel15;
  984. private javax.swing.JLabel jLabel16;
  985. private javax.swing.JLabel jLabel17;
  986. private javax.swing.JLabel jLabel18;
  987. private javax.swing.JLabel jLabel19;
  988. private javax.swing.JLabel jLabel2;
  989. private javax.swing.JLabel jLabel20;
  990. private javax.swing.JLabel jLabel21;
  991. private javax.swing.JLabel jLabel23;
  992. private javax.swing.JLabel jLabel3;
  993. private javax.swing.JLabel jLabel4;
  994. private javax.swing.JLabel jLabel5;
  995. private javax.swing.JLabel jLabel6;
  996. private javax.swing.JLabel jLabel7;
  997. private javax.swing.JLabel jLabel8;
  998. private javax.swing.JLabel jLabel9;
  999. private javax.swing.JList<String> jList1;
  1000. private javax.swing.JList<String> jList2;
  1001. private static javax.swing.JMenuBar jMenuBar1;
  1002. private javax.swing.JMenuItem jMenuItem1;
  1003. private javax.swing.JMenuItem jMenuItem2;
  1004. private javax.swing.JMenuItem jMenuItem3;
  1005. private javax.swing.JPasswordField jPasswordField1;
  1006. private javax.swing.JPasswordField jPasswordField2;
  1007. private javax.swing.JRadioButton jRadioButton1;
  1008. private javax.swing.JRadioButton jRadioButton2;
  1009. private javax.swing.JDialog jRegister;
  1010. private javax.swing.JScrollPane jScrollPane1;
  1011. private javax.swing.JScrollPane jScrollPane3;
  1012. private javax.swing.JScrollPane jScrollPane4;
  1013. private javax.swing.JScrollPane jScrollPane5;
  1014. private javax.swing.JDialog jSearch;
  1015. private javax.swing.JTextArea jTextArea2;
  1016. private javax.swing.JTextField jTextField1;
  1017. private javax.swing.JTextField jUsername;
  1018. private javax.swing.JTextField searchField;
  1019. // End of variables declaration
  1020. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement