/Users/18604/NetBeansProjects/IA_NetBeans_Project/src/computer/science/ia/MainGUI.java |
1 /*
2 * To change this license header, choose License Headers in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor. 0003070008
5 */
6 package computer.science.ia;
7
8 import java.util.ArrayList;
9 import javax.swing.JFrame;
10 import javax.swing.JOptionPane;
11 import static javax.swing.JOptionPane.ERROR_MESSAGE;
12 import java.io.File;
13 import java.io.FileNotFoundException;
14 import java.io.FileOutputStream;
15 import java.io.IOException;
16 import java.util.Set;
17 import java.util.TreeMap;
18 import java.util.logging.Level;
19 import java.util.logging.Logger;
20 import org.apache.poi.ss.usermodel.Cell;
21 import org.apache.poi.xssf.usermodel.XSSFRow;
22 import org.apache.poi.xssf.usermodel.XSSFSheet;
23 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
24
25
26
27 /**
28 *
29 * @author 18604
30 */
31 public class MainGUI extends javax.swing.JFrame {
32
33
34
35
36
37
38 private ArrayList<ComputerBuild> computerparts = new ArrayList<ComputerBuild>();
39
40 ComputerBuild computer1;
41 ComputerBuild highSpec;
42 ComputerBuild lowSpec;
43 double cpuCost;
44 double cpuCoolerCost;
45 double gpuCost;
46 double motherboardCost;
47 double storageCost;
48 double caseCost;
49 double powerSupplyCost;
50 double cpuScore;
51 double cpuCoolerScore;
52 double gpuScore;
53 double motherboardScore;
54 double storageScore;
55
56
57 String cpu = "null";
58 String cpuCooler = "null";
59 String gpu = "null";
60 String motherboard = "null";
61 String storage = "null";
62 String computercase = "null";
63 String powersupply = "null";
64 String budget = "null";
65
66 double totalBudget = 0.0;
67 double totalCost = 0.0;
68 double totalBenchmark = 0.0;
69 double averageBenchmark = 0.0;
70
71
72
73
74 /**
75 * Creates new form MainGUI
76 */
77 public MainGUI() {
78 initComponents();
79 myInitComponents();
80 welcomeTab();
81 }
82
83 public void myInitComponents(){
84 cpuButtonGroup.add(cpuIntelRB);
85 cpuButtonGroup.add(cpuAmdRB);
86 cpuCoolerButtonGroup.add(cpuCoolerHeatsinkRB);
87 cpuCoolerButtonGroup.add(cpuWaterCoolerRB);
88 gpuButtonGroup.add(gpuNvidiaRB);
89 gpuButtonGroup.add(gpuAmdRB);
90 storageButtonGroup.add(storageM2RB);
91 storageButtonGroup.add(storageSSDRB);
92 budgetButtonGroup.add(budgetLowRB);
93 budgetButtonGroup.add(budgetMediumRB);
94 budgetButtonGroup.add(budgetHighRB);
95 //JOptionPane
96 //YOu'll have to user\n escape characters for new line \n
97
98 }// groups all the components together
99
100 public void okSetInformation(){
101 if(cpuIntelRB.isSelected()){
102 cpu = "Intel";
103 amdCPUComboBox.setEnabled(false);
104 amdMotherboardComboBox.setEnabled(false);
105 }else if(cpuAmdRB.isSelected()){
106 cpu = "AMD";
107 intelCPUComboBox.setEnabled(false);
108 intelMotherboardComboBox.setEnabled(false);
109 }else{
110 JOptionPane.showMessageDialog(null, "Please fill in the CPU section", "Error", ERROR_MESSAGE);
111 }
112
113
114 if(cpuCoolerHeatsinkRB.isSelected()){
115 cpuCooler = "Heatsink";
116 watercoolComboBox.setEnabled(false);
117 }else if(cpuWaterCoolerRB.isSelected()){
118 cpuCooler = "Water Cooler";
119 heatsinkComboBox.setEnabled(false);
120 }else{
121 JOptionPane.showMessageDialog(null, "Please fill in the CPU Cooler section", "Error", ERROR_MESSAGE);
122 }
123
124
125 if(gpuNvidiaRB.isSelected()){
126 gpu = "Nvidia";
127 amdGPUComboBox.setEnabled(false);
128 }else if(gpuAmdRB.isSelected()){
129 gpu = "Amd";
130 nvidiaGPUComboBox.setEnabled(false);
131 }else{
132 JOptionPane.showMessageDialog(null, "Please fill in the GPU section", "Error", ERROR_MESSAGE);
133 }
134
135
136 if(storageM2RB.isSelected()){
137 storage = "M.2";
138 ssdStorageComboBox.setEnabled(false);
139 }else if(storageSSDRB.isSelected()){
140 storage = "SSD";
141 m2storageComboBox.setEnabled(false);
142 }else{
143 JOptionPane.showMessageDialog(null, "Please fill in the GPU section", "Error", ERROR_MESSAGE);
144 }
145
146 if(budgetLowRB.isSelected()){
147 budget = "low";
148 }else if(budgetMediumRB.isSelected()){
149 budget = "medium";
150 }else if(budgetHighRB.isSelected()){
151 budget = "high";
152 }else{
153 JOptionPane.showMessageDialog(null, "Please fill in the Budget section", "Error", ERROR_MESSAGE);
154 }
155 }// pre: takes information selected in the information tab. Post : sets the selected radio buttons in the information tab
156
157 public void clearAll1(){
158 cpu = "null";
159 cpuCooler = "null";
160 gpu = "null";
161 storage = "null";
162 budget = "null";
163
164 cpuButtonGroup.clearSelection();
165 cpuCoolerButtonGroup.clearSelection();
166 gpuButtonGroup.clearSelection();
167 storageButtonGroup.clearSelection();
168 budgetButtonGroup.clearSelection();
169 }// clears all the choices in the information tab
170
171 public void continueSetSpecifcations(){
172 if(amdCPUComboBox.isEnabled()){
173 cpu = (String) (amdCPUComboBox.getSelectedItem());
174 }
175 else{
176 cpu = (String) (intelCPUComboBox.getSelectedItem());
177 }
178
179
180 if(heatsinkComboBox.isEnabled()){
181 cpuCooler = (String) (heatsinkComboBox.getSelectedItem());
182 }else{
183 cpuCooler = (String) (watercoolComboBox.getSelectedItem());
184 }
185
186
187 if(nvidiaGPUComboBox.isEnabled()){
188 gpu = (String) (nvidiaGPUComboBox.getSelectedItem());
189 }else{
190 gpu = (String) (amdGPUComboBox.getSelectedItem());
191 }
192
193
194 if(amdMotherboardComboBox.isEnabled()){
195 motherboard = (String) (amdMotherboardComboBox.getSelectedItem());
196 }else{
197 motherboard = (String) (intelMotherboardComboBox.getSelectedItem());
198 }
199
200
201 if(m2storageComboBox.isEnabled()){
202 storage = (String) (m2storageComboBox.getSelectedItem());
203 }else{
204 storage = (String) (ssdStorageComboBox.getSelectedItem());
205 }
206
207 computercase = (String) (caseComboBox.getSelectedItem());
208 powersupply = (String) (powersupplyComboBox.getSelectedItem());
209 computer1 = new ComputerBuild(cpu, cpuCooler, gpu, motherboard, storage, computercase, powersupply, 0.0);
210 }// pre: takes information set in the specifications tab Post: sets the selected combo boxes for each part in the specifcations tab
211
212 public void clearAll2(){
213 JFrame f;
214 f = new JFrame();
215 if (JOptionPane.showConfirmDialog(f, "Are you sure? You will have to go back to the information page.") == JOptionPane.YES_OPTION) {
216 cpu = "null";
217 cpuCooler = "null";
218 gpu = "null";
219 storage = "null";
220 computercase = "null";
221 powersupply = "null";
222 budget = "null";
223
224
225 amdCPUComboBox.setEnabled(true);
226 intelCPUComboBox.setEnabled(true);
227 heatsinkComboBox.setEnabled(true);
228 watercoolComboBox.setEnabled(true);
229 nvidiaGPUComboBox.setEnabled(true);
230 amdGPUComboBox.setEnabled(true);
231 amdMotherboardComboBox.setEnabled(true);
232 intelMotherboardComboBox.setEnabled(true);
233 m2storageComboBox.setEnabled(true);
234 ssdStorageComboBox.setEnabled(true);
235 caseComboBox.setEnabled(true);
236 powersupplyComboBox.setEnabled(true);
237
238 amdCPUComboBox.setSelectedIndex(0);
239 intelCPUComboBox.setSelectedIndex(0);
240 heatsinkComboBox.setSelectedIndex(0);
241 watercoolComboBox.setSelectedIndex(0);
242 nvidiaGPUComboBox.setSelectedIndex(0);
243 amdGPUComboBox.setSelectedIndex(0);
244 amdMotherboardComboBox.setSelectedIndex(0);
245 intelMotherboardComboBox.setSelectedIndex(0);
246 m2storageComboBox.setSelectedIndex(0);
247 ssdStorageComboBox.setSelectedIndex(0);
248 caseComboBox.setSelectedIndex(0);
249 powersupplyComboBox.setSelectedIndex(0);
250 }
251 }// clears all the combo boxes in the specifcations tab
252
253 public void refreshSetCostPerformance(){
254 partsTable.setValueAt(computer1.getCpu(),0, 1);
255 if(computer1.getCpu().equals("Ryzen 3 2200g")){
256 partsTable.setValueAt("130", 0, 2);
257 cpuCost += 130;
258 partsTable.setValueAt("3", 0, 3);
259 cpuScore += 3;
260 }
261 else if(computer1.getCpu().equals("Ryzen 5 3600x")){
262 partsTable.setValueAt("200", 0, 2);
263 cpuCost += 200;
264 partsTable.setValueAt("4", 0, 3);
265 cpuScore += 3.5;
266 }
267 else if(computer1.getCpu().equals("Ryzen 7 3700x")){
268 partsTable.setValueAt("300", 0, 2);
269 cpuCost += 300;
270 partsTable.setValueAt("4.5", 0, 3);
271 cpuScore += 4.5;
272 }
273 else if(computer1.getCpu().equals("Ryzen 9 3900x")){
274 partsTable.setValueAt("420", 0, 2);
275 cpuCost += 420;
276 partsTable.setValueAt("5", 0, 3);
277 cpuScore += 5;
278 }
279 else if(computer1.getCpu().equals("Core i3-8100")){
280 partsTable.setValueAt("120", 0, 2);
281 cpuCost += 120;
282 partsTable.setValueAt("2.5", 0, 3);
283 cpuScore += 2.5;
284 }
285 else if(computer1.getCpu().equals("Core i5-9600K")){
286 partsTable.setValueAt("220", 0, 2);
287 cpuCost += 220;
288 partsTable.setValueAt("2.5", 0, 3);
289 cpuScore += 3;
290 }
291 else if(computer1.getCpu().equals("Core i7-9700K")){
292 partsTable.setValueAt("380", 0, 2);
293 cpuCost += 380;
294 partsTable.setValueAt("4", 0, 3);
295 cpuScore += 4;
296 }else if(computer1.getCpu().equals("Core i9-9900K")){
297 partsTable.setValueAt("500" , 0, 2);
298 cpuCost += 500;
299 partsTable.setValueAt("5", 0, 3);
300 cpuScore += 5;
301 }else{
302 JOptionPane.showMessageDialog(null, "Please fill in the CPU section", "Error", ERROR_MESSAGE);
303 }
304
305
306
307
308 partsTable.setValueAt(computer1.getCpuCooler(),1, 1);
309 if(computer1.getCpuCooler().equals("Cryorig R1 Ultimate")){
310 partsTable.setValueAt("90", 1, 2);
311 cpuCoolerCost += 90;
312 partsTable.setValueAt("3", 1, 3);
313 cpuCoolerScore += 3;
314 }else if(computer1.getCpuCooler().equals("Noctua NH-D15")){
315 partsTable.setValueAt("95", 1 ,2);
316 cpuCoolerCost += 95;
317 partsTable.setValueAt("4", 1, 3);
318 cpuCoolerScore += 4;
319 }else if(computer1.getCpuCooler().equals("Corsair H100i Pro")){
320 partsTable.setValueAt("100", 1 ,2);
321 cpuCoolerCost += 100;
322 partsTable.setValueAt("4", 1, 3);
323 cpuCoolerScore += 4;
324 }else if(computer1.getCpuCooler().equals("NZXT Kraken X53")){
325 partsTable.setValueAt("160", 1, 2);
326 cpuCoolerCost += 160;
327 partsTable.setValueAt("5", 1, 3);
328 cpuCoolerScore += 5;
329 }else{
330 JOptionPane.showMessageDialog(null, "Please fill in the CPU Cooler section", "Error", ERROR_MESSAGE);
331 }
332
333 partsTable.setValueAt(computer1.getGpu(),2, 1);
334 if(computer1.getGpu().equals("Asus ROG Strix RTX 2060 OC")){
335 partsTable.setValueAt("400", 2, 2);
336 gpuCost += 400;
337 partsTable.setValueAt("3.5", 2, 3);
338 gpuScore += 3.5;
339 }else if(computer1.getGpu().equals("Gigabyte Windforce OC RTX 2070")){
340 partsTable.setValueAt("700", 2, 2);
341 gpuCost += 600;
342 partsTable.setValueAt("4", 2, 3);
343 gpuScore += 4;
344 }else if(computer1.getGpu().equals("EVGA Super XC Gaming RTX 2080")){
345 partsTable.setValueAt("800", 2, 2);
346 gpuCost += 800;
347 partsTable.setValueAt("5", 2, 3);
348 gpuScore += 5;
349 }else if(computer1.getGpu().equals("Sapphire Nitro+ RX 5700 XT")){
350 partsTable.setValueAt("450", 2, 2);
351 gpuCost += 500;
352 partsTable.setValueAt("4", 2, 3);
353 gpuScore += 4;
354 }else if(computer1.getGpu().equals("Asus ROG Strix RX 5700")){
355 partsTable.setValueAt("380", 2, 2);
356 gpuCost += 400;
357 partsTable.setValueAt("3.5", 2, 3);
358 gpuScore += 3.5;
359 }else if(computer1.getGpu().equals("PowerColor Red Devil RX 5600 XT")){
360 partsTable.setValueAt("300", 2, 2);
361 gpuCost += 300;
362 partsTable.setValueAt("3", 2, 3);
363 gpuScore += 3;
364 }else{
365 JOptionPane.showMessageDialog(null, "Please fill in the GPU section", "Error", ERROR_MESSAGE);
366 }
367
368
369 partsTable.setValueAt(computer1.getMotherboard(),3, 1);
370 if(computer1.getMotherboard().equals("MSI Pro Carbon AC B450")){
371 partsTable.setValueAt("190", 3, 2);
372 motherboardCost += 190;
373 partsTable.setValueAt("3", 3, 3);
374 motherboardScore += 3;
375 }else if(computer1.getMotherboard().equals("Asus Prime X470-Pro")){
376 partsTable.setValueAt("210", 3, 2);
377 motherboardCost += 210;
378 partsTable.setValueAt("4", 3, 3);
379 motherboardScore += 2;
380 }else if(computer1.getMotherboard().equals("Gigabyte Aorus Master X570")){
381 partsTable.setValueAt("350", 3, 2);
382 motherboardCost += 350;
383 partsTable.setValueAt("5", 3, 3);
384 motherboardScore += 5;
385 }else if(computer1.getMotherboard().equals("MSI MAG Tomahawk Z390")){
386 partsTable.setValueAt("160",3, 2);
387 motherboardCost += 160;
388 partsTable.setValueAt("4", 3, 3);
389 motherboardScore += 4;
390 }else if(computer1.getMotherboard().equals("Asus ROG Maximus XI Hero Z390")){
391 partsTable.setValueAt("210", 3, 2);
392 motherboardCost += 210;
393 partsTable.setValueAt("4.5", 3, 3);
394 motherboardScore += 4.5;
395 }else if(computer1.getMotherboard().equals("MSI MEG Ace Z390")){
396 partsTable.setValueAt("360", 3, 2);
397 motherboardCost += 360;
398 partsTable.setValueAt("5", 3, 3);
399 motherboardScore += 5;
400 }else{
401 JOptionPane.showMessageDialog(null, "Please fill in the Motherboard section", "Error", ERROR_MESSAGE);
402 }
403
404
405 partsTable.setValueAt(computer1.getStorage(),4, 1);
406 if(computer1.getStorage().equals("Intel SSD 660P 500 GB")){
407 partsTable.setValueAt("80", 4, 2);
408 storageCost += 80;
409 partsTable.setValueAt("4", 4, 3);
410 storageScore += 4;
411 }else if(computer1.getStorage().equals("Western Digital Black Series 1 TB")){
412 partsTable.setValueAt("500", 4, 2);
413 storageCost += 500;
414 partsTable.setValueAt("4.5", 4, 3);
415 storageScore += 4.5;
416 }else if(computer1.getStorage().equals("Samsung 970 Evo 2 TB")){
417 partsTable.setValueAt("970", 4, 2);
418 storageCost += 970;
419 partsTable.setValueAt("5", 4, 3);
420 storageScore += 5;
421 }else if(computer1.getStorage().equals("Crucial MX500 500 GB")){
422 partsTable.setValueAt("70", 4, 2);
423 storageCost += 70;
424 partsTable.setValueAt("3", 4, 3);
425 storageScore += 3.5;
426 }else if(computer1.getStorage().equals("Western Digital Blue 1 TB")){
427 partsTable.setValueAt("120", 4, 2);
428 storageCost += 120;
429 partsTable.setValueAt("3", 4, 3);
430 storageScore += 4;
431 }else if(computer1.getStorage().equals("Samsung 860 Evo 2 TB")){
432 partsTable.setValueAt("280", 4, 2);
433 storageCost += 280;
434 partsTable.setValueAt("3", 4, 3);
435 storageScore += 4.5;
436 }else{
437 JOptionPane.showMessageDialog(null, "Please fill in the Storage section", "Error", ERROR_MESSAGE);
438 }
439
440
441 partsTable.setValueAt(computer1.getComputerCase(),5, 1);
442 if(computer1.getComputerCase().equals("NZXT H510")){
443 partsTable.setValueAt("70", 5, 2);
444 caseCost += 70;
445 }else if(computer1.getComputerCase().equals("Fractal Design Define R6")){
446 partsTable.setValueAt("170", 5, 2);
447 caseCost += 170;
448 }else if(computer1.getComputerCase().equals("Corsair Carbide 275R")){
449 partsTable.setValueAt("75", 5, 2);
450 caseCost += 75;
451 }else if(computer1.getComputerCase().equals("Phanteks Eclipse P400")){
452 partsTable.setValueAt("90", 5, 2);
453 caseCost += 90;
454 }else{
455 JOptionPane.showMessageDialog(null, "Please fill in the Case section", "Error", ERROR_MESSAGE);
456 }
457
458 partsTable.setValueAt(computer1.getPowersupply(),6, 1);
459 if(computer1.getPowersupply().equals("Corsair RMx 650 Watts")){
460 partsTable.setValueAt("120", 6, 2);
461 powerSupplyCost += 120;
462 }else if(computer1.getPowersupply().equals("Corsair RMi 750 Watts")){
463 partsTable.setValueAt("180", 6, 2);
464 powerSupplyCost += 180;
465 }else if(computer1.getPowersupply().equals("Corsair HX 850 Watts")){
466 partsTable.setValueAt("250", 6, 2);
467 powerSupplyCost += 250;
468 }else{
469 JOptionPane.showMessageDialog(null, "Please fill in the Power Supply section", "Error", ERROR_MESSAGE);
470 }
471
472
473
474 }//gets all the selected combo boxes and displays it on the partsTable in the cost and performance tab
475
476 public void calculateTotalCost(){
477 totalCost = cpuCost + cpuCoolerCost + gpuCost + motherboardCost + storageCost + caseCost + powerSupplyCost;
478 totalCostTable.setValueAt(totalCost, 0, 1);
479
480 if(budget.equals("low")){
481 totalCostTable.setValueAt("1000.0", 0, 0);
482 totalBudget += 1000.0;
483 }else if(budget.equals("medium")){
484 totalCostTable.setValueAt("2000.0", 0, 0);
485 totalBudget += 2000.0;
486 }else if(budget.equals("high")){
487 totalCostTable.setValueAt("4000.0", 0, 0);
488 totalBudget += 4000.0;
489 }else{
490 System.out.println("Error");
491 }
492
493 if(totalCost > totalBudget){
494 JOptionPane.showMessageDialog(null, "Overallocated budget, please return to the Specifications to modify the parts within the budget.", "Error", ERROR_MESSAGE);
495 }
496 }// calculcates the total cost of the whole pc
497
498 public void calculateAverageScore(){
499 totalBenchmark = cpuScore + cpuCoolerScore + gpuScore + motherboardScore + storageScore;
500 averageBenchmark = totalBenchmark / 5;
501 averageScoreTable.setValueAt(averageBenchmark, 0,0);
502 }// calculates the average benchmark of the current pc
503
504 public void highestSpecPC(){
505 highSpec = new ComputerBuild(cpu, cpuCooler, gpu, motherboard, storage, computercase, powersupply, 0.0);
506
507 cpu = "Intel";
508 cpuCooler = "Water Cooler";
509 gpu = "Nvidia";
510 storage = "M.2";
511 budget = "high";
512
513 cpuIntelRB.setSelected(true);
514 cpuWaterCoolerRB.setSelected(true);
515 gpuNvidiaRB.setSelected(true);
516 storageM2RB.setSelected(true);
517 budgetHighRB.setSelected(true);
518
519 intelCPUComboBox.setSelectedItem("Core i9-9900k");
520 watercoolComboBox.setSelectedItem("NZXT Kraken X53");
521 nvidiaGPUComboBox.setSelectedItem("EVGA Super XC Gaming RTX 2080");
522 intelMotherboardComboBox.setSelectedItem("MSI MEG Ace Z390");
523 m2storageComboBox.setSelectedItem("Samsung 970 Evo 2 TB");
524 caseComboBox.setSelectedItem("Fractal Design Define R6");
525 powersupplyComboBox.setSelectedItem("Corsair HX 850 Watts");
526
527 amdCPUComboBox.setEnabled(false);
528 heatsinkComboBox.setEnabled(false);
529 amdGPUComboBox.setEnabled(false);
530 amdMotherboardComboBox.setEnabled(false);
531 ssdStorageComboBox.setEnabled(false);
532
533 partsTable.setValueAt("Core i9-9900k",0,1);
534 partsTable.setValueAt("500" , 0, 2);
535 cpuCost += 500;
536 partsTable.setValueAt("5", 0, 3);
537 cpuScore += 5;
538
539 partsTable.setValueAt("NZXT Kraken X53",1,1);
540 partsTable.setValueAt("160", 1, 2);
541 cpuCoolerCost += 160;
542 partsTable.setValueAt("5", 1, 3);
543 cpuCoolerScore += 5;
544
545 partsTable.setValueAt("EVGA Super XC Gaming RTX 2080",2,1);
546 partsTable.setValueAt("800", 2, 2);
547 gpuCost += 800;
548 partsTable.setValueAt("5", 2, 3);
549 gpuScore += 5;
550
551 partsTable.setValueAt("MSI MEG Ace Z390",3,1);
552 partsTable.setValueAt("360", 3, 2);
553 motherboardCost += 360;
554 partsTable.setValueAt("5", 3, 3);
555 motherboardScore += 5;
556
557 partsTable.setValueAt("Samsung 970 Evo 2 TB",4,1);
558 partsTable.setValueAt("970", 4, 2);
559 storageCost += 970;
560 partsTable.setValueAt("5", 4, 3);
561 storageScore += 5;
562
563 partsTable.setValueAt("Fractal Design Define R6",5,1);
564 partsTable.setValueAt("90", 5, 2);
565 caseCost += 90;
566
567 partsTable.setValueAt("Corsair HX 850 Watts", 6, 1);
568 partsTable.setValueAt("250", 6, 2);
569 powerSupplyCost += 250;
570
571 JOptionPane.showMessageDialog(null, "Proceed to the Cost and Performance Tab");
572 }// sets all the highest spec pc possible
573
574 public void lowestSpecPC(){
575 lowSpec = new ComputerBuild(cpu, cpuCooler, gpu, motherboard, storage, computercase, powersupply, 0.0);
576
577 cpu = "AMD";
578 cpuCooler = "Heatsink";
579 gpu = "AMD";
580 storage = "SSD";
581 budget = "low";
582
583 cpuAmdRB.setSelected(true);
584 cpuCoolerHeatsinkRB.setSelected(true);
585 gpuAmdRB.setSelected(true);
586 storageSSDRB.setSelected(true);
587 budgetLowRB.setSelected(true);
588
589 amdCPUComboBox.setSelectedItem("Ryzen 3 2200g");
590 heatsinkComboBox.setSelectedItem("Cryorig R1 Ultimate");
591 amdGPUComboBox.setSelectedItem("PowerColor Red Devil RX 5600 XT");
592 amdMotherboardComboBox.setSelectedItem("MSI Pro Carbon AC B450");
593 ssdStorageComboBox.setSelectedItem("Crucial MX500 500 GB");
594 caseComboBox.setSelectedItem("NZXT H510");
595 powersupplyComboBox.setSelectedItem("Corsair RMx 650 Watts");
596
597 intelCPUComboBox.setEnabled(false);
598 watercoolComboBox.setEnabled(false);
599 nvidiaGPUComboBox.setEnabled(false);
600 intelMotherboardComboBox.setEnabled(false);
601 m2storageComboBox.setEnabled(false);
602
603 partsTable.setValueAt("Ryzen 3 2200g",0,1);
604 partsTable.setValueAt("130", 0, 2);
605 cpuCost += 130;
606 partsTable.setValueAt("3", 0, 3);
607 cpuScore += 3;
608
609 partsTable.setValueAt("Cryorig R1 Ultimate",1,1);
610 partsTable.setValueAt("90", 1, 2);
611 cpuCoolerCost += 90;
612 partsTable.setValueAt("3", 1, 3);
613 cpuCoolerScore += 3;
614
615 partsTable.setValueAt("PowerColor Red Devil RX 5600 XT",2,1);
616 partsTable.setValueAt("300", 2, 2);
617 gpuCost += 300;
618 partsTable.setValueAt("3", 2, 3);
619 gpuScore += 3;
620
621 partsTable.setValueAt("MSI Pro Carbon AC B450",3,1);
622 partsTable.setValueAt("190", 3, 2);
623 motherboardCost += 190;
624 partsTable.setValueAt("3", 3, 3);
625 motherboardScore += 3;
626
627 partsTable.setValueAt("Crucial MX500 500 GB",4,1);
628 partsTable.setValueAt("80", 4, 2);
629 storageCost += 80;
630 partsTable.setValueAt("4", 4, 3);
631 storageScore += 4;
632
633 partsTable.setValueAt("NZXT H510",5,1);
634 partsTable.setValueAt("70", 5, 2);
635 caseCost += 70;
636
637 partsTable.setValueAt("Corsair RMx 650 Watts", 6, 1);
638 partsTable.setValueAt("120", 6, 2);
639 powerSupplyCost += 120;
640
641 JOptionPane.showMessageDialog(null, "Proceed to the Cost and Performance Tab");
642 }// sets all the lowest spec pc possible
643
644 public void clearAll3(){
645 partsTable.setValueAt("",0,1);
646 partsTable.setValueAt("" , 0, 2);
647 cpuCost = 0;
648 partsTable.setValueAt("", 0, 3);
649 cpuScore = 0;
650
651 partsTable.setValueAt("",1,1);
652 partsTable.setValueAt("", 1, 2);
653 cpuCoolerCost = 0;
654 partsTable.setValueAt("", 1, 3);
655 cpuCoolerScore = 0;
656
657 partsTable.setValueAt("",2,1);
658 partsTable.setValueAt("", 2, 2);
659 gpuCost = 0;
660 partsTable.setValueAt("", 2, 3);
661 gpuScore = 0;
662
663 partsTable.setValueAt("",3,1);
664 partsTable.setValueAt("", 3, 2);
665 motherboardCost = 0;
666 partsTable.setValueAt("", 3, 3);
667 motherboardScore = 0;
668
669 partsTable.setValueAt("",4,1);
670 partsTable.setValueAt("", 4, 2);
671 storageCost = 0;
672 partsTable.setValueAt("", 4, 3);
673 storageScore = 0;
674
675 partsTable.setValueAt("",5,1);
676 partsTable.setValueAt("", 5, 2);
677 caseCost = 0;
678
679 partsTable.setValueAt("", 6, 1);
680 partsTable.setValueAt("", 6, 2);
681 powerSupplyCost = 0;
682
683 totalCostTable.setValueAt("", 0, 0);
684 totalCostTable.setValueAt("", 0, 1);
685 totalBudget = 0.0;
686 totalCost = 0.0;
687
688 averageScoreTable.setValueAt("", 0,0);
689 totalBenchmark = 0.0;
690 averageBenchmark = 0.0;
691 }// clears all the tables in the cost and performance tab
692
693 public void ultimateClear(){
694 partsTable.setValueAt("",0,1);
695 partsTable.setValueAt("" , 0, 2);
696 cpuCost = 0;
697 partsTable.setValueAt("", 0, 3);
698 cpuScore = 0;
699
700 partsTable.setValueAt("",1,1);
701 partsTable.setValueAt("", 1, 2);
702 cpuCoolerCost = 0;
703 partsTable.setValueAt("", 1, 3);
704 cpuCoolerScore = 0;
705
706 partsTable.setValueAt("",2,1);
707 partsTable.setValueAt("", 2, 2);
708 gpuCost = 0;
709 partsTable.setValueAt("", 2, 3);
710 gpuScore = 0;
711
712 partsTable.setValueAt("",3,1);
713 partsTable.setValueAt("", 3, 2);
714 motherboardCost = 0;
715 partsTable.setValueAt("", 3, 3);
716 motherboardScore = 0;
717
718 partsTable.setValueAt("",4,1);
719 partsTable.setValueAt("", 4, 2);
720 storageCost = 0;
721 partsTable.setValueAt("", 4, 3);
722 storageScore = 0;
723
724 partsTable.setValueAt("",5,1);
725 partsTable.setValueAt("", 5, 2);
726 caseCost = 0;
727
728 partsTable.setValueAt("", 6, 1);
729 partsTable.setValueAt("", 6, 2);
730 powerSupplyCost = 0;
731
732 totalCostTable.setValueAt("", 0, 0);
733 totalCostTable.setValueAt("", 0, 1);
734 totalBudget = 0.0;
735 totalCost = 0.0;
736
737 averageScoreTable.setValueAt("", 0,0);
738 totalBenchmark = 0.0;
739 averageBenchmark = 0.0;
740
741 JFrame f;
742 f = new JFrame();
743 if (JOptionPane.showConfirmDialog(f, "Are you sure? You will have to go back to the information page.") == JOptionPane.YES_OPTION) {
744
745 cpu = "null";
746 cpuCooler = "null";
747 gpu = "null";
748 storage = "null";
749 budget = "null";
750
751 cpuButtonGroup.clearSelection();
752 cpuCoolerButtonGroup.clearSelection();
753 gpuButtonGroup.clearSelection();
754 storageButtonGroup.clearSelection();
755 budgetButtonGroup.clearSelection();
756
757 amdCPUComboBox.setEnabled(true);
758 intelCPUComboBox.setEnabled(true);
759 heatsinkComboBox.setEnabled(true);
760 watercoolComboBox.setEnabled(true);
761 nvidiaGPUComboBox.setEnabled(true);
762 amdGPUComboBox.setEnabled(true);
763 amdMotherboardComboBox.setEnabled(true);
764 intelMotherboardComboBox.setEnabled(true);
765 m2storageComboBox.setEnabled(true);
766 ssdStorageComboBox.setEnabled(true);
767 caseComboBox.setEnabled(true);
768 powersupplyComboBox.setEnabled(true);
769
770 amdCPUComboBox.setSelectedIndex(0);
771 intelCPUComboBox.setSelectedIndex(0);
772 heatsinkComboBox.setSelectedIndex(0);
773 watercoolComboBox.setSelectedIndex(0);
774 nvidiaGPUComboBox.setSelectedIndex(0);
775 amdGPUComboBox.setSelectedIndex(0);
776 amdMotherboardComboBox.setSelectedIndex(0);
777 intelMotherboardComboBox.setSelectedIndex(0);
778 m2storageComboBox.setSelectedIndex(0);
779 ssdStorageComboBox.setSelectedIndex(0);
780 caseComboBox.setSelectedIndex(0);
781 powersupplyComboBox.setSelectedIndex(0);
782 }
783 }//resets the whole program to a clean slate
784
785 public void welcomeTab(){
786 JOptionPane.showMessageDialog(null, "<html> Welcome to my program <br> Fill out the nessecary information on the information tab <br> Then go to the specifacations tab, to choose your component <br> Then go to the Cost and Performance tab, to finalize your choices </html>");
787 JOptionPane.showMessageDialog(null, "Optional: You could choose between a preset of the highest and lowest spec pc on the information tab");
788
789 }// welcome tab :)
790
791 public String getCellValue(int x, int y){
792 return partsTable.getValueAt(x, y).toString();
793 } // gets each cell value
794
795 public void jTableToExcel(){
796 XSSFWorkbook wb = new XSSFWorkbook();
797 XSSFSheet ws = wb.createSheet();
798
799 //loads data to treemap
800 TreeMap<String,Object[]> data = new TreeMap<>();
801 data.put("0", new Object[]{partsTable.getColumnName(0),partsTable.getColumnName(1), partsTable.getColumnName(2), partsTable.getColumnName(3)});
802 data.put("1", new Object[]{getCellValue(0,0),getCellValue(0,1), getCellValue(0,2), getCellValue(0,3)});
803 data.put("2", new Object[]{getCellValue(1,0),getCellValue(1,1), getCellValue(1,2), getCellValue(1,3)});
804 data.put("3", new Object[]{getCellValue(2,0),getCellValue(2,1), getCellValue(2,2), getCellValue(2,3)});
805 data.put("4", new Object[]{getCellValue(3,0),getCellValue(3,1), getCellValue(3,2), getCellValue(3,3)});
806 data.put("5", new Object[]{getCellValue(4,0),getCellValue(4,1), getCellValue(4,2), getCellValue(4,3)});
807 data.put("6", new Object[]{getCellValue(5,0),getCellValue(5,1), getCellValue(5,2), getCellValue(5,3)});
808 data.put("7", new Object[]{getCellValue(6,0),getCellValue(6,1), getCellValue(6,2), getCellValue(6,3)});
809
810 //write to sheet
811 Set<String> ids = data.keySet();
812 XSSFRow row;
813 int rowID = 0;
814
815 //getting data per key
816 for(String key: ids){
817 row=ws.createRow(rowID++);
818 Object[] values = data.get(key);
819 int cellID = 0;
820 for(Object o: values){
821 Cell cell = row.createCell(cellID++);
822 cell.setCellValue(o.toString());
823 }
824 }
825
826 //locating the file path directory
827 try{
828 FileOutputStream fos = null;
829 try {
830 fos = new FileOutputStream(new File("/Users/18604/Desktop/computer.xlsx"));
831 } catch (FileNotFoundException ex) {
832 Logger.getLogger(MainGUI.class.getName()).log(Level.SEVERE, null, ex);
833 }
834 wb.write(fos);
835 fos.close();
836 } catch (IOException ex) {
837 Logger.getLogger(MainGUI.class.getName()).log(Level.SEVERE, null, ex);
838 }
839
840 JOptionPane.showMessageDialog(null, "Exported Successfully !");
841
842 }// exports partsTable to excel
843
844
845
1639 }// </editor-fold>
1640
1641 private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {
1642 System.exit(0);
1643 }
1644
1645 private void clearAllButtonMouseReleased(java.awt.event.MouseEvent evt) {
1646 // TODO add your handling code here:
1647 ultimateClear();
1648 }
1649
1650 private void totalCostButtonActionPerformed(java.awt.event.ActionEvent evt) {
1651 // TODO add your handling code here:
1652 }
1653
1654 private void totalCostButtonMouseReleased(java.awt.event.MouseEvent evt) {
1655 // TODO add your handling code here:
1656 calculateTotalCost();
1657 }
1658
1659 private void refreshButtonMouseReleased(java.awt.event.MouseEvent evt) {
1660 // TODO add your handling code here:
1661 refreshSetCostPerformance();
1662 }
1663
1664 private void revertButtonActionPerformed(java.awt.event.ActionEvent evt) {
1665 // TODO add your handling code here:
1666 }
1667
1668 private void revertButtonMouseReleased(java.awt.event.MouseEvent evt) {
1669 // TODO add your handling code here:
1670 clearAll3();
1671 }
1672
1673 private void getScoreButtonActionPerformed(java.awt.event.ActionEvent evt) {
1674 // TODO add your handling code here:
1675 }
1676
1677 private void getScoreButtonMouseReleased(java.awt.event.MouseEvent evt) {
1678 // TODO add your handling code here:
1679 calculateAverageScore();
1680 }
1681
1682 private void intelMotherboardComboBoxActionPerformed(java.awt.event.ActionEvent evt) {
1683 // TODO add your handling code here:
1684 }
1685
1686 private void intelCPUComboBoxActionPerformed(java.awt.event.ActionEvent evt) {
1687 // TODO add your handling code here:
1688 }
1689
1690 private void saveButtonMouseReleased(java.awt.event.MouseEvent evt) {
1691 // TODO add your handling code here:
1692 continueSetSpecifcations();
1693
1694 }
1695
1696 private void clearSpecButtonActionPerformed(java.awt.event.ActionEvent evt) {
1697 // TODO add your handling code here:
1698 }
1699
1700 private void clearSpecButtonMouseReleased(java.awt.event.MouseEvent evt) {
1701 // TODO add your handling code here:
1702 clearAll2();
1703 }
1704
1705 private void amdMotherboardComboBoxActionPerformed(java.awt.event.ActionEvent evt) {
1706 // TODO add your handling code here:
1707 }
1708
1709 private void heatsinkComboBoxActionPerformed(java.awt.event.ActionEvent evt) {
1710 // TODO add your handling code here:
1711 }
1712
1713 private void amdCPUComboBoxActionPerformed(java.awt.event.ActionEvent evt) {
1714 // TODO add your handling code here:
1715 }
1716
1717 private void infoButtonCPUActionPerformed(java.awt.event.ActionEvent evt) {
1718 // TODO add your handling code here:
1719 }
1720
1721 private void clearInfoButtonMouseReleased(java.awt.event.MouseEvent evt) {
1722 // TODO add your handling code here:
1723 clearAll1();
1724 }
1725
1726 private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {
1727 // TODO add your handling code here:
1728 }
1729
1730 private void okButtonMouseReleased(java.awt.event.MouseEvent evt) {
1731 // TODO add your handling code here:
1732 okSetInformation();
1733 }
1734
1735 private void cpuCoolerHeatsinkRBActionPerformed(java.awt.event.ActionEvent evt) {
1736 // TODO add your handling code here:
1737 }
1738
1739 private void cpuWaterCoolerRBActionPerformed(java.awt.event.ActionEvent evt) {
1740 // TODO add your handling code here:
1741 }
1742
1743 private void cpuIntelRBActionPerformed(java.awt.event.ActionEvent evt) {
1744 // TODO add your handling code here:
1745 }
1746
1747 private void budgetHighRBActionPerformed(java.awt.event.ActionEvent evt) {
1748 // TODO add your handling code here:
1749 }
1750
1751 private void budgetLowRBActionPerformed(java.awt.event.ActionEvent evt) {
1752 // TODO add your handling code here:
1753 }
1754
1755 private void budgetMediumRBActionPerformed(java.awt.event.ActionEvent evt) {
1756 // TODO add your handling code here:
1757 }
1758
1759 private void storageSSDRBActionPerformed(java.awt.event.ActionEvent evt) {
1760 // TODO add your handling code here:
1761 }
1762
1763 private void storageM2RBActionPerformed(java.awt.event.ActionEvent evt) {
1764 // TODO add your handling code here:
1765 }
1766
1767 private void gpuAmdRBActionPerformed(java.awt.event.ActionEvent evt) {
1768 // TODO add your handling code here:
1769 }
1770
1771 private void gpuNvidiaRBActionPerformed(java.awt.event.ActionEvent evt) {
1772 // TODO add your handling code here:
1773 }
1774
1775 private void highSpecPcButtonMouseReleased(java.awt.event.MouseEvent evt) {
1776 // TODO add your handling code here:
1777 highestSpecPC();
1778 }
1779
1780 private void lowSpecPCButtonMouseReleased(java.awt.event.MouseEvent evt) {
1781 // TODO add your handling code here:
1782 lowestSpecPC();
1783 }
1784
1785 private void exportButtonMouseReleased(java.awt.event.MouseEvent evt) {
1786 // TODO add your handling code here:
1787 jTableToExcel();
1788 }
1789
1790 /**
1791 * @param args the command line arguments
1792 */
1793 public static void main(String args[]) {
1794 /* Set the Nimbus look and feel */
1795 //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
1796 /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
1797 * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
1798 */
1799 try {
1800 for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
1801 if ("Nimbus".equals(info.getName())) {
1802 javax.swing.UIManager.setLookAndFeel(info.getClassName());
1803 break;
1804 }
1805 }
1806 } catch (ClassNotFoundException ex) {
1807 java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1808 } catch (InstantiationException ex) {
1809 java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1810 } catch (IllegalAccessException ex) {
1811 java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1812 } catch (javax.swing.UnsupportedLookAndFeelException ex) {
1813 java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1814 }
1815 //</editor-fold>
1816
1817 /* Create and display the form */
1818 java.awt.EventQueue.invokeLater(new Runnable() {
1819 public void run() {
1820 new MainGUI().setVisible(true);
1821 }
1822 });
1823 }
SAMPLE OF GENERATED CODE BY NETBEANS
/**
846 * This method is called from within the constructor to initialize the form.
847 * WARNING: Do NOT modify this code. The content of this method is always
848 * regenerated by the Form Editor.
849 */
850 @SuppressWarnings("unchecked")
851 // <editor-fold defaultstate="collapsed" desc="Generated Code">
852 private void initComponents() {
853
854 jMenu1 = new javax.swing.JMenu();
855 jMenu2 = new javax.swing.JMenu();
856 cpuButtonGroup = new javax.swing.ButtonGroup();
857 cpuCoolerButtonGroup = new javax.swing.ButtonGroup();
858 gpuButtonGroup = new javax.swing.ButtonGroup();
859 storageButtonGroup = new javax.swing.ButtonGroup();
860 budgetButtonGroup = new javax.swing.ButtonGroup();
861 GUITabbedPane = new javax.swing.JTabbedPane();
862 informationPanel = new javax.swing.JPanel();
863 cpuChoiceLabel = new javax.swing.JLabel();
864 cpuAmdRB = new javax.swing.JRadioButton();
865 gpuChoiceLabel = new javax.swing.JLabel();
866 gpuNvidiaRB = new javax.swing.JRadioButton();
867 gpuAmdRB = new javax.swing.JRadioButton();
868 storageChoiceLable = new javax.swing.JLabel();
869 storageM2RB = new javax.swing.JRadioButton();
870 storageSSDRB = new javax.swing.JRadioButton();
871 initialInfoLable = new javax.swing.JLabel();
872 budgetChoiceLable = new javax.swing.JLabel();
873 budgetMediumRB = new javax.swing.JRadioButton();
874 budgetLowRB = new javax.swing.JRadioButton();
875 budgetHighRB = new javax.swing.JRadioButton();
876 cpuCoolerLabel = new javax.swing.JLabel();
877 cpuIntelRB = new javax.swing.JRadioButton();
878 cpuWaterCoolerRB = new javax.swing.JRadioButton();
879 cpuCoolerHeatsinkRB = new javax.swing.JRadioButton();
880 okButton = new javax.swing.JButton();
881 clearInfoButton = new javax.swing.JButton();
882 infoButtonCPU = new javax.swing.JButton();
883 infoButtonCPUCooler = new javax.swing.JButton();
884 infoButtonGPU = new javax.swing.JButton();
885 infoButtonStorage = new javax.swing.JButton();
886 infoButtonBudget = new javax.swing.JButton();
887 highSpecPcButton = new javax.swing.JButton();
888 lowSpecPCButton = new javax.swing.JButton();
889 highestSpecLabel = new javax.swing.JLabel();
890 lowestSpecLabel = new javax.swing.JLabel();
891 specsPanel = new javax.swing.JPanel();
892 CPUSpecLabel = new javax.swing.JLabel();
893 amdCPUComboBox = new javax.swing.JComboBox<>();
894 componentsLabel = new javax.swing.JLabel();
895 selectionsLabel = new javax.swing.JLabel();
896 CPUCoolerSpecLabel = new javax.swing.JLabel();
897 m2storageComboBox = new javax.swing.JComboBox<>();
898 GPUSpecLabel = new javax.swing.JLabel();
899 heatsinkComboBox = new javax.swing.JComboBox<>();
900 motherboardSpecLabel = new javax.swing.JLabel();
901 nvidiaGPUComboBox = new javax.swing.JComboBox<>();
902 storageSpecLabel = new javax.swing.JLabel();
903 amdMotherboardComboBox = new javax.swing.JComboBox<>();
904 caseSpecLabel = new javax.swing.JLabel();
905 caseComboBox = new javax.swing.JComboBox<>();
906 PowerSupplySpecLabel = new javax.swing.JLabel();
907 powersupplyComboBox = new javax.swing.JComboBox<>();
908 clearSpecButton = new javax.swing.JButton();
909 saveButton = new javax.swing.JButton();
910 intelCPUComboBox = new javax.swing.JComboBox<>();
911 watercoolComboBox = new javax.swing.JComboBox<>();
912 amdGPUComboBox = new javax.swing.JComboBox<>();
913 intelMotherboardComboBox = new javax.swing.JComboBox<>();
914 ssdStorageComboBox = new javax.swing.JComboBox<>();
915 costPerformancePanel = new javax.swing.JPanel();
916 jScrollPane2 = new javax.swing.JScrollPane();
917 partsTable = new javax.swing.JTable();
918 getScoreButton = new javax.swing.JButton();
919 exportButton = new javax.swing.JButton();
920 revertButton = new javax.swing.JButton();
921 costperformanceLabel = new javax.swing.JLabel();
922 refreshButton = new javax.swing.JButton();
923 totalCostButton = new javax.swing.JButton();
924 jScrollPane3 = new javax.swing.JScrollPane();
925 totalCostTable = new javax.swing.JTable();
926 jScrollPane1 = new javax.swing.JScrollPane();
927 averageScoreTable = new javax.swing.JTable();
928 clearAllButton = new javax.swing.JButton();
929 menuBar = new javax.swing.JMenuBar();
930 fileMenu = new javax.swing.JMenu();
931 openMenuItem = new javax.swing.JMenuItem();
932 saveMenuItem = new javax.swing.JMenuItem();
933 saveAsMenuItem = new javax.swing.JMenuItem();
934 exitMenuItem = new javax.swing.JMenuItem();
935 editMenu = new javax.swing.JMenu();
936 cutMenuItem = new javax.swing.JMenuItem();
937 copyMenuItem = new javax.swing.JMenuItem();
938 pasteMenuItem = new javax.swing.JMenuItem();
939 deleteMenuItem = new javax.swing.JMenuItem();
940 helpMenu = new javax.swing.JMenu();
941 contentsMenuItem = new javax.swing.JMenuItem();
942 aboutMenuItem = new javax.swing.JMenuItem();
943
944 jMenu1.setText("jMenu1");
945
946 jMenu2.setText("jMenu2");
947
948 setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
949
950 cpuChoiceLabel.setText("CPU");
951
952 cpuAmdRB.setText("AMD");
953
954 gpuChoiceLabel.setText("GPU");
955
956 gpuNvidiaRB.setText("NVIDIA");
957 gpuNvidiaRB.addActionListener(new java.awt.event.ActionListener() {
958 public void actionPerformed(java.awt.event.ActionEvent evt) {
959 gpuNvidiaRBActionPerformed(evt);
960 }
961 });
962
963 gpuAmdRB.setText("AMD");
964 gpuAmdRB.addActionListener(new java.awt.event.ActionListener() {
965 public void actionPerformed(java.awt.event.ActionEvent evt) {
966 gpuAmdRBActionPerformed(evt);
967 }
968 });
969
970 storageChoiceLable.setText("Storage");
971
972 storageM2RB.setText("M.2");
973 storageM2RB.addActionListener(new java.awt.event.ActionListener() {
974 public void actionPerformed(java.awt.event.ActionEvent evt) {
975 storageM2RBActionPerformed(evt);
976 }
977 });
978
979 storageSSDRB.setText("SSD");
980 storageSSDRB.addActionListener(new java.awt.event.ActionListener() {
981 public void actionPerformed(java.awt.event.ActionEvent evt) {
982 storageSSDRBActionPerformed(evt);
983 }
984 });
985
986 initialInfoLable.setText("Fill out the initial information:");
987
988 budgetChoiceLable.setText("Budget");
989
990 budgetMediumRB.setText("Medium-End");
991 budgetMediumRB.addActionListener(new java.awt.event.ActionListener() {
992 public void actionPerformed(java.awt.event.ActionEvent evt) {
993 budgetMediumRBActionPerformed(evt);
994 }
995 });
996
997 budgetLowRB.setText("Low-End");
998 budgetLowRB.addActionListener(new java.awt.event.ActionListener() {
999 public void actionPerformed(java.awt.event.ActionEvent evt) {
1000 budgetLowRBActionPerformed(evt);
1001 }
1002 });
1003
1004 budgetHighRB.setText("High-End");
1005 budgetHighRB.addActionListener(new java.awt.event.ActionListener() {
1006 public void actionPerformed(java.awt.event.ActionEvent evt) {
1007 budgetHighRBActionPerformed(evt);
1008 }
1009 });
1010
1011 cpuCoolerLabel.setText("CPU Cooler");
1012
1013 cpuIntelRB.setText("Intel");
1014 cpuIntelRB.addActionListener(new java.awt.event.ActionListener() {
1015 public void actionPerformed(java.awt.event.ActionEvent evt) {
1016 cpuIntelRBActionPerformed(evt);
1017 }
1018 });
1019
1020 cpuWaterCoolerRB.setText("Water-cooled");
1021 cpuWaterCoolerRB.addActionListener(new java.awt.event.ActionListener() {
1022 public void actionPerformed(java.awt.event.ActionEvent evt) {
1023 cpuWaterCoolerRBActionPerformed(evt);
1024 }
1025 });
1026
1027 cpuCoolerHeatsinkRB.setText("Air-cooled");
1028 cpuCoolerHeatsinkRB.addActionListener(new java.awt.event.ActionListener() {
1029 public void actionPerformed(java.awt.event.ActionEvent evt) {
1030 cpuCoolerHeatsinkRBActionPerformed(evt);
1031 }
1032 });
1033
1034 okButton.setText("Ok");
1035 okButton.addMouseListener(new java.awt.event.MouseAdapter() {
1036 public void mouseReleased(java.awt.event.MouseEvent evt) {
1037 okButtonMouseReleased(evt);
1038 }
1039 });
1040 okButton.addActionListener(new java.awt.event.ActionListener() {
1041 public void actionPerformed(java.awt.event.ActionEvent evt) {
1042 okButtonActionPerformed(evt);
1043 }
1044 });
1045
1046 clearInfoButton.setText("Clear");
1047 clearInfoButton.addMouseListener(new java.awt.event.MouseAdapter() {
1048 public void mouseReleased(java.awt.event.MouseEvent evt) {
1049 clearInfoButtonMouseReleased(evt);
1050 }
1051 });
1052
1053 infoButtonCPU.setText("i");
1054 infoButtonCPU.addActionListener(new java.awt.event.ActionListener() {
1055 public void actionPerformed(java.awt.event.ActionEvent evt) {
1056 infoButtonCPUActionPerformed(evt);
1057 }
1058 });
1059
1060 infoButtonCPUCooler.setText("i");
1061
1062 infoButtonGPU.setText("i");
1063
1064 infoButtonStorage.setText("i");
1065
1066 infoButtonBudget.setText("i");
1067
1068 highSpecPcButton.setText("Ok");
1069 highSpecPcButton.addMouseListener(new java.awt.event.MouseAdapter() {
1070 public void mouseReleased(java.awt.event.MouseEvent evt) {
1071 highSpecPcButtonMouseReleased(evt);
1072 }
1073 });
1074
1075 lowSpecPCButton.setText("Ok");
1076 lowSpecPCButton.addMouseListener(new java.awt.event.MouseAdapter() {
1077 public void mouseReleased(java.awt.event.MouseEvent evt) {
1078 lowSpecPCButtonMouseReleased(evt);
1079 }
1080 });
1081
1082 highestSpecLabel.setText("Get me the highest spec pc ! : ");
1083
1084 lowestSpecLabel.setText("Get me the lowest spec pc !:");
1085
1086 javax.swing.GroupLayout informationPanelLayout = new javax.swing.GroupLayout(informationPanel);
1087 informationPanel.setLayout(informationPanelLayout);
1088 informationPanelLayout.setHorizontalGroup(
1089 informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1090 .addGroup(informationPanelLayout.createSequentialGroup()
1091 .addGap(170, 170, 170)
1092 .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
1093 .addComponent(infoButtonCPU, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
1094 .addComponent(infoButtonCPUCooler, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
1095 .addComponent(infoButtonGPU, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
1096 .addComponent(infoButtonStorage, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
1097 .addComponent(infoButtonBudget, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
1098 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1099 .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1100 .addGroup(informationPanelLayout.createSequentialGroup()
1101 .addComponent(cpuCoolerLabel)
1102 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1103 .addComponent(cpuCoolerHeatsinkRB)
1104 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1105 .addComponent(cpuWaterCoolerRB))
1106 .addGroup(informationPanelLayout.createSequentialGroup()
1107 .addComponent(gpuChoiceLabel)
1108 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1109 .addComponent(gpuNvidiaRB)
1110 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
1111 .addComponent(gpuAmdRB))
1112 .addGroup(informationPanelLayout.createSequentialGroup()
1113 .addComponent(storageChoiceLable)
1114 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1115 .addComponent(storageM2RB)
1116 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1117 .addComponent(storageSSDRB))
1118 .addGroup(informationPanelLayout.createSequentialGroup()
1119 .addComponent(cpuChoiceLabel)
1120 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
1121 .addComponent(cpuIntelRB)
1122 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1123 .addComponent(cpuAmdRB))
1124 .addGroup(informationPanelLayout.createSequentialGroup()
1125 .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
1126 .addGroup(informationPanelLayout.createSequentialGroup()
1127 .addComponent(okButton)
1128 .addGap(18, 18, 18)
1129 .addComponent(clearInfoButton))
1130 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, informationPanelLayout.createSequentialGroup()
1131 .addComponent(budgetChoiceLable)
1132 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
1133 .addComponent(budgetLowRB)
1134 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1135 .addComponent(budgetMediumRB)))
1136 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1137 .addComponent(budgetHighRB))
1138 .addGroup(informationPanelLayout.createSequentialGroup()
1139 .addComponent(initialInfoLable)
1140 .addGap(87, 87, 87)
1141 .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1142 .addGroup(informationPanelLayout.createSequentialGroup()
1143 .addComponent(lowestSpecLabel)
1144 .addGap(18, 18, 18)
1145 .addComponent(lowSpecPCButton))
1146 .addGroup(informationPanelLayout.createSequentialGroup()
1147 .addComponent(highestSpecLabel)
1148 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1149 .addComponent(highSpecPcButton)))))
1150 .addGap(31, 31, Short.MAX_VALUE))
1151 );
1152 informationPanelLayout.setVerticalGroup(
1153 informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1154 .addGroup(informationPanelLayout.createSequentialGroup()
1155 .addGap(36, 36, 36)
1156 .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1157 .addComponent(initialInfoLable)
1158 .addComponent(highestSpecLabel)
1159 .addComponent(highSpecPcButton))
1160 .addGap(18, 18, 18)
1161 .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1162 .addComponent(lowestSpecLabel)
1163 .addComponent(lowSpecPCButton))
1164 .addGap(6, 6, 6)
1165 .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1166 .addComponent(cpuChoiceLabel)
1167 .addComponent(cpuAmdRB)
1168 .addComponent(cpuIntelRB)
1169 .addComponent(infoButtonCPU))
1170 .addGap(3, 3, 3)
1171 .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1172 .addComponent(cpuCoolerLabel)
1173 .addComponent(cpuWaterCoolerRB)
1174 .addComponent(cpuCoolerHeatsinkRB)
1175 .addComponent(infoButtonCPUCooler))
1176 .addGap(18, 18, 18)
1177 .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1178 .addComponent(gpuChoiceLabel)
1179 .addComponent(gpuNvidiaRB)
1180 .addComponent(gpuAmdRB)
1181 .addComponent(infoButtonGPU))
1182 .addGap(27, 27, 27)
1183 .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1184 .addComponent(storageChoiceLable)
1185 .addComponent(storageM2RB)
1186 .addComponent(storageSSDRB)
1187 .addComponent(infoButtonStorage))
1188 .addGap(18, 18, 18)
1189 .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1190 .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1191 .addComponent(budgetChoiceLable)
1192 .addComponent(infoButtonBudget))
1193 .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1194 .addComponent(budgetMediumRB)
1195 .addComponent(budgetLowRB)
1196 .addComponent(budgetHighRB)))
1197 .addGap(43, 43, 43)
1198 .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1199 .addComponent(clearInfoButton)
1200 .addComponent(okButton))
1201 .addContainerGap(488, Short.MAX_VALUE))
1202 );
1203
1204 GUITabbedPane.addTab("Information", informationPanel);
1205
1206 CPUSpecLabel.setText("CPU");
1207
1208 amdCPUComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Choose an AMD CPU", "Ryzen 3 2200g", "Ryzen 5 3600x", "Ryzen 7 3700x", "Ryzen 9 3900x" }));
1209 amdCPUComboBox.addActionListener(new java.awt.event.ActionListener() {
1210 public void actionPerformed(java.awt.event.ActionEvent evt) {
1211 amdCPUComboBoxActionPerformed(evt);
1212 }
1213 });
1214
1215 componentsLabel.setText("Components:");
1216
1217 selectionsLabel.setText("Selection:");
1218
1219 CPUCoolerSpecLabel.setText("CPU Cooler");
1220
1221 m2storageComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Choose a M.2 Storage", "Intel SSD 660P 500 GB", "Western Digital Black Series 1 TB", "Samsung 970 Evo 2 TB" }));
1222
1223 GPUSpecLabel.setText("GPU");
1224
1225 heatsinkComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Choose an Air-Cooler", "Cryorig R1 Ultimate", "Noctua NH-D15", " " }));
1226 heatsinkComboBox.addActionListener(new java.awt.event.ActionListener() {
1227 public void actionPerformed(java.awt.event.ActionEvent evt) {
1228 heatsinkComboBoxActionPerformed(evt);
1229 }
1230 });
1231
1232 motherboardSpecLabel.setText("Motherboard");
1233
1234 nvidiaGPUComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Choose a NVIDIA GPU", "Asus ROG Strix RTX 2060 OC", "Gigabyte Windforce OC RTX 2070", "EVGA Super XC Gaming RTX 2080" }));
1235
1236 storageSpecLabel.setText("Storage");
1237
1238 amdMotherboardComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Choose an AMD motherboard", "MSI Pro Carbon AC B450", "Asus Prime X470-Pro", "Gigabyte Aorus Master X570" }));
1239 amdMotherboardComboBox.addActionListener(new java.awt.event.ActionListener() {
1240 public void actionPerformed(java.awt.event.ActionEvent evt) {
1241 amdMotherboardComboBoxActionPerformed(evt);
1242 }
1243 });
1244
1245 caseSpecLabel.setText("Case");
1246
1247 caseComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Choose a Case", "NZXT H510", "Corsair Carbide 275R", "Phanteks Eclipse P400", "Fractal Design Define R6" }));
1248
1249 PowerSupplySpecLabel.setText("Power Supply");
1250
1251 powersupplyComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Choose a Power Supply", "Corsair RMx 650 Watts", "Corsair RMi 750 Watts", "Corsair HX 850 Watts" }));
1252
1253 clearSpecButton.setText("Clear");
1254 clearSpecButton.addMouseListener(new java.awt.event.MouseAdapter() {
1255 public void mouseReleased(java.awt.event.MouseEvent evt) {
1256 clearSpecButtonMouseReleased(evt);
1257 }
1258 });
1259 clearSpecButton.addActionListener(new java.awt.event.ActionListener() {
1260 public void actionPerformed(java.awt.event.ActionEvent evt) {
1261 clearSpecButtonActionPerformed(evt);
1262 }
1263 });
1264
1265 saveButton.setText("Continue");
1266 saveButton.addMouseListener(new java.awt.event.MouseAdapter() {
1267 public void mouseReleased(java.awt.event.MouseEvent evt) {
1268 saveButtonMouseReleased(evt);
1269 }
1270 });
1271
1272 intelCPUComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Choose an Intel CPU", "Core i3-8100", "Core i5-9600K", "Core i7-9700K", "Core i9-9900K" }));
1273 intelCPUComboBox.addActionListener(new java.awt.event.ActionListener() {
1274 public void actionPerformed(java.awt.event.ActionEvent evt) {
1275 intelCPUComboBoxActionPerformed(evt);
1276 }
1277 });
1278
1279 watercoolComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Choose a Water-Cooler ", "Corsair H100i Pro", "NZXT Kraken X53" }));
1280
1281 amdGPUComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Choose an AMD GPU", "PowerColor Red Devil RX 5600 XT", "Asus ROG Strix RX 5700", "Sapphire Nitro+ RX 5700 XT" }));
1282
1283 intelMotherboardComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Choose an Intel Motherboard", "MSI MAG Tomahawk Z390", "Asus ROG Maximus XI Hero Z390", "MSI MEG Ace Z390" }));
1284 intelMotherboardComboBox.addActionListener(new java.awt.event.ActionListener() {
1285 public void actionPerformed(java.awt.event.ActionEvent evt) {
1286 intelMotherboardComboBoxActionPerformed(evt);
1287 }
1288 });
1289
1290 ssdStorageComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Choose a SSD ", "Crucial MX500 500 GB", "Western Digital Blue 1 TB", "Samsung 860 Evo 2 TB" }));
1291
1292 javax.swing.GroupLayout specsPanelLayout = new javax.swing.GroupLayout(specsPanel);
1293 specsPanel.setLayout(specsPanelLayout);
1294 specsPanelLayout.setHorizontalGroup(
1295 specsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1296 .addGroup(specsPanelLayout.createSequentialGroup()
1297 .addGroup(specsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1298 .addGroup(specsPanelLayout.createSequentialGroup()
1299 .addGap(278, 278, 278)
1300 .addComponent(saveButton)
1301 .addGap(53, 53, 53)
1302 .addComponent(clearSpecButton))
1303 .addGroup(specsPanelLayout.createSequentialGroup()
1304 .addGap(124, 124, 124)
1305 .addGroup(specsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1306 .addComponent(CPUSpecLabel)
1307 .addGroup(specsPanelLayout.createSequentialGroup()
1308 .addGroup(specsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1309 .addComponent(componentsLabel)
1310 .addComponent(CPUCoolerSpecLabel)
1311 .addComponent(GPUSpecLabel)
1312 .addComponent(motherboardSpecLabel)
1313 .addComponent(storageSpecLabel)
1314 .addComponent(caseSpecLabel)
1315 .addComponent(PowerSupplySpecLabel))
1316 .addGroup(specsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1317 .addGroup(specsPanelLayout.createSequentialGroup()
1318 .addGap(123, 123, 123)
1319 .addComponent(selectionsLabel))
1320 .addGroup(specsPanelLayout.createSequentialGroup()
1321 .addGap(44, 44, 44)
1322 .addGroup(specsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1323 .addGroup(specsPanelLayout.createSequentialGroup()
1324 .addComponent(nvidiaGPUComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1325 .addGap(18, 18, 18)
1326 .addComponent(amdGPUComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1327 .addGroup(specsPanelLayout.createSequentialGroup()
1328 .addComponent(amdMotherboardComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1329 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
1330 .addComponent(intelMotherboardComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1331 .addGroup(specsPanelLayout.createSequentialGroup()
1332 .addComponent(m2storageComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE)
1333 .addGap(18, 18, 18)
1334 .addComponent(ssdStorageComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE))
1335 .addComponent(caseComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1336 .addComponent(powersupplyComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1337 .addGroup(specsPanelLayout.createSequentialGroup()
1338 .addGroup(specsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1339 .addComponent(heatsinkComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1340 .addComponent(intelCPUComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1341 .addGap(18, 18, 18)
1342 .addGroup(specsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1343 .addComponent(amdCPUComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1344 .addComponent(watercoolComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))))))))
1345 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
1346 );
1347 specsPanelLayout.setVerticalGroup(
1348 specsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1349 .addGroup(specsPanelLayout.createSequentialGroup()
1350 .addGap(45, 45, 45)
1351 .addGroup(specsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1352 .addComponent(componentsLabel)
1353 .addComponent(selectionsLabel))
1354 .addGap(18, 18, 18)
1355 .addGroup(specsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1356 .addComponent(CPUSpecLabel)
1357 .addComponent(intelCPUComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1358 .addComponent(amdCPUComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1359 .addGap(16, 16, 16)
1360 .addGroup(specsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1361 .addComponent(CPUCoolerSpecLabel)
1362 .addComponent(heatsinkComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1363 .addComponent(watercoolComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1364 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
1365 .addGroup(specsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1366 .addComponent(nvidiaGPUComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1367 .addComponent(GPUSpecLabel)
1368 .addComponent(amdGPUComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1369 .addGap(18, 18, 18)
1370 .addGroup(specsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1371 .addComponent(motherboardSpecLabel)
1372 .addComponent(amdMotherboardComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1373 .addComponent(intelMotherboardComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1374 .addGap(18, 18, 18)
1375 .addGroup(specsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1376 .addComponent(storageSpecLabel)
1377 .addComponent(m2storageComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1378 .addComponent(ssdStorageComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1379 .addGap(18, 18, 18)
1380 .addGroup(specsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1381 .addComponent(caseSpecLabel)
1382 .addComponent(caseComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1383 .addGap(18, 18, 18)
1384 .addGroup(specsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1385 .addComponent(PowerSupplySpecLabel)
1386 .addComponent(powersupplyComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1387 .addGap(115, 115, 115)
1388 .addGroup(specsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1389 .addComponent(saveButton)
1390 .addComponent(clearSpecButton))
1391 .addContainerGap(377, Short.MAX_VALUE))
1392 );
1393
1394 GUITabbedPane.addTab("Specifications", specsPanel);
1395
1396 partsTable.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
1397 partsTable.setModel(new javax.swing.table.DefaultTableModel(
1398 new Object [][] {
1399 {"Cpu", null, null, null},
1400 {"Cpu Cooler", null, null, null},
1401 {"Gpu", null, null, null},
1402 {"Motherboard", null, null, null},
1403 {"Storage", null, null, ""},
1404 {"Case", null, null, "-"},
1405 {"Power Supply", null, null, "-"}
1406 },
1407 new String [] {
1408 "Part", "Part Name", "Cost", "Benchmark (out of 5)"
1409 }
1410 ));
1411 partsTable.setAutoscrolls(false);
1412 partsTable.setGridColor(new java.awt.Color(0, 0, 0));
1413 jScrollPane2.setViewportView(partsTable);
1414
1415 getScoreButton.setText("Get Average Benchmark Score (out of 5) ");
1416 getScoreButton.addMouseListener(new java.awt.event.MouseAdapter() {
1417 public void mouseReleased(java.awt.event.MouseEvent evt) {
1418 getScoreButtonMouseReleased(evt);
1419 }
1420 });
1421 getScoreButton.addActionListener(new java.awt.event.ActionListener() {
1422 public void actionPerformed(java.awt.event.ActionEvent evt) {
1423 getScoreButtonActionPerformed(evt);
1424 }
1425 });
1426
1427 exportButton.setText("Export ");
1428 exportButton.addMouseListener(new java.awt.event.MouseAdapter() {
1429 public void mouseReleased(java.awt.event.MouseEvent evt) {
1430 exportButtonMouseReleased(evt);
1431 }
1432 });
1433
1434 revertButton.setText("Clear");
1435 revertButton.addMouseListener(new java.awt.event.MouseAdapter() {
1436 public void mouseReleased(java.awt.event.MouseEvent evt) {
1437 revertButtonMouseReleased(evt);
1438 }
1439 });
1440 revertButton.addActionListener(new java.awt.event.ActionListener() {
1441 public void actionPerformed(java.awt.event.ActionEvent evt) {
1442 revertButtonActionPerformed(evt);
1443 }
1444 });
1445
1446 costperformanceLabel.setText("Cost and Performance:");
1447
1448 refreshButton.setText("Refresh");
1449 refreshButton.addMouseListener(new java.awt.event.MouseAdapter() {
1450 public void mouseReleased(java.awt.event.MouseEvent evt) {
1451 refreshButtonMouseReleased(evt);
1452 }
1453 });
1454
1455 totalCostButton.setText("Get Total Cost");
1456 totalCostButton.addMouseListener(new java.awt.event.MouseAdapter() {
1457 public void mouseReleased(java.awt.event.MouseEvent evt) {
1458 totalCostButtonMouseReleased(evt);
1459 }
1460 });
1461 totalCostButton.addActionListener(new java.awt.event.ActionListener() {
1462 public void actionPerformed(java.awt.event.ActionEvent evt) {
1463 totalCostButtonActionPerformed(evt);
1464 }
1465 });
1466
1467 totalCostTable.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
1468 totalCostTable.setModel(new javax.swing.table.DefaultTableModel(
1469 new Object [][] {
1470 {null, null}
1471 },
1472 new String [] {
1473 "Budget", "Total Cost"
1474 }
1475 ));
1476 totalCostTable.setAutoscrolls(false);
1477 totalCostTable.setGridColor(new java.awt.Color(0, 0, 0));
1478 jScrollPane3.setViewportView(totalCostTable);
1479
1480 averageScoreTable.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
1481 averageScoreTable.setModel(new javax.swing.table.DefaultTableModel(
1482 new Object [][] {
1483 {null}
1484 },
1485 new String [] {
1486 "Average Benchmark Scores"
1487 }
1488 ));
1489 averageScoreTable.setAutoscrolls(false);
1490 averageScoreTable.setGridColor(new java.awt.Color(0, 0, 0));
1491 jScrollPane1.setViewportView(averageScoreTable);
1492
1493 clearAllButton.setText("Clear All");
1494 clearAllButton.addMouseListener(new java.awt.event.MouseAdapter() {
1495 public void mouseReleased(java.awt.event.MouseEvent evt) {
1496 clearAllButtonMouseReleased(evt);
1497 }
1498 });
1499
1500 javax.swing.GroupLayout costPerformancePanelLayout = new javax.swing.GroupLayout(costPerformancePanel);
1501 costPerformancePanel.setLayout(costPerformancePanelLayout);
1502 costPerformancePanelLayout.setHorizontalGroup(
1503 costPerformancePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1504 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, costPerformancePanelLayout.createSequentialGroup()
1505 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
1506 .addComponent(exportButton)
1507 .addGap(349, 349, 349))
1508 .addGroup(costPerformancePanelLayout.createSequentialGroup()
1509 .addGroup(costPerformancePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1510 .addGroup(costPerformancePanelLayout.createSequentialGroup()
1511 .addGap(148, 148, 148)
1512 .addGroup(costPerformancePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1513 .addComponent(totalCostButton)
1514 .addComponent(getScoreButton)
1515 .addGroup(costPerformancePanelLayout.createSequentialGroup()
1516 .addComponent(costperformanceLabel)
1517 .addGap(18, 18, 18)
1518 .addComponent(refreshButton)
1519 .addGap(18, 18, 18)
1520 .addComponent(revertButton)
1521 .addGap(18, 18, 18)
1522 .addComponent(clearAllButton))
1523 .addGroup(costPerformancePanelLayout.createSequentialGroup()
1524 .addGap(6, 6, 6)
1525 .addGroup(costPerformancePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1526 .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1527 .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)))))
1528 .addGroup(costPerformancePanelLayout.createSequentialGroup()
1529 .addContainerGap()
1530 .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 774, javax.swing.GroupLayout.PREFERRED_SIZE)))
1531 .addContainerGap(16, Short.MAX_VALUE))
1532 );
1533 costPerformancePanelLayout.setVerticalGroup(
1534 costPerformancePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1535 .addGroup(costPerformancePanelLayout.createSequentialGroup()
1536 .addGap(30, 30, 30)
1537 .addGroup(costPerformancePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1538 .addComponent(costperformanceLabel)
1539 .addComponent(refreshButton)
1540 .addComponent(revertButton)
1541 .addComponent(clearAllButton))
1542 .addGap(18, 18, 18)
1543 .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
1544 .addGap(18, 18, 18)
1545 .addComponent(getScoreButton)
1546 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
1547 .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
1548 .addGap(34, 34, 34)
1549 .addComponent(totalCostButton)
1550 .addGap(18, 18, 18)
1551 .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
1552 .addGap(91, 91, 91)
1553 .addComponent(exportButton)
1554 .addContainerGap(315, Short.MAX_VALUE))
1555 );
1556
1557 GUITabbedPane.addTab("Cost and Performance", costPerformancePanel);
1558
1559 fileMenu.setMnemonic('f');
1560 fileMenu.setText("File");
1561
1562 openMenuItem.setMnemonic('o');
1563 openMenuItem.setText("Open");
1564 fileMenu.add(openMenuItem);
1565
1566 saveMenuItem.setMnemonic('s');
1567 saveMenuItem.setText("Save");
1568 fileMenu.add(saveMenuItem);
1569
1570 saveAsMenuItem.setMnemonic('a');
1571 saveAsMenuItem.setText("Save As ...");
1572 saveAsMenuItem.setDisplayedMnemonicIndex(5);
1573 fileMenu.add(saveAsMenuItem);
1574
1575 exitMenuItem.setMnemonic('x');
1576 exitMenuItem.setText("Exit");
1577 exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
1578 public void actionPerformed(java.awt.event.ActionEvent evt) {
1579 exitMenuItemActionPerformed(evt);
1580 }
1581 });
1582 fileMenu.add(exitMenuItem);
1583
1584 menuBar.add(fileMenu);
1585
1586 editMenu.setMnemonic('e');
1587 editMenu.setText("Edit");
1588
1589 cutMenuItem.setMnemonic('t');
1590 cutMenuItem.setText("Cut");
1591 editMenu.add(cutMenuItem);
1592
1593 copyMenuItem.setMnemonic('y');
1594 copyMenuItem.setText("Copy");
1595 editMenu.add(copyMenuItem);
1596
1597 pasteMenuItem.setMnemonic('p');
1598 pasteMenuItem.setText("Paste");
1599 editMenu.add(pasteMenuItem);
1600
1601 deleteMenuItem.setMnemonic('d');
1602 deleteMenuItem.setText("Delete");
1603 editMenu.add(deleteMenuItem);
1604
1605 menuBar.add(editMenu);
1606
1607 helpMenu.setMnemonic('h');
1608 helpMenu.setText("Help");
1609
1610 contentsMenuItem.setMnemonic('c');
1611 contentsMenuItem.setText("Contents");
1612 helpMenu.add(contentsMenuItem);
1613
1614 aboutMenuItem.setMnemonic('a');
1615 aboutMenuItem.setText("About");
1616 helpMenu.add(aboutMenuItem);
1617
1618 menuBar.add(helpMenu);
1619
1620 setJMenuBar(menuBar);
1621
1622 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
1623 getContentPane().setLayout(layout);
1624 layout.setHorizontalGroup(
1625 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1626 .addGroup(layout.createSequentialGroup()
1627 .addComponent(GUITabbedPane, javax.swing.GroupLayout.PREFERRED_SIZE, 817, javax.swing.GroupLayout.PREFERRED_SIZE)
1628 .addGap(0, 38, Short.MAX_VALUE))
1629 );
1630 layout.setVerticalGroup(
1631 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1632 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
1633 .addContainerGap()
1634 .addComponent(GUITabbedPane)
1635 .addContainerGap())
1636 );
1637
1638 pack();
1825 // Variables declaration - do not modify
1826 private javax.swing.JLabel CPUCoolerSpecLabel;
1827 private javax.swing.JLabel CPUSpecLabel;
1828 private javax.swing.JLabel GPUSpecLabel;
1829 private javax.swing.JTabbedPane GUITabbedPane;
1830 private javax.swing.JLabel PowerSupplySpecLabel;
1831 private javax.swing.JMenuItem aboutMenuItem;
1832 private javax.swing.JComboBox<String> amdCPUComboBox;
1833 private javax.swing.JComboBox<String> amdGPUComboBox;
1834 private javax.swing.JComboBox<String> amdMotherboardComboBox;
1835 private javax.swing.JTable averageScoreTable;
1836 private javax.swing.ButtonGroup budgetButtonGroup;
1837 private javax.swing.JLabel budgetChoiceLable;
1838 private javax.swing.JRadioButton budgetHighRB;
1839 private javax.swing.JRadioButton budgetLowRB;
1840 private javax.swing.JRadioButton budgetMediumRB;
1841 private javax.swing.JComboBox<String> caseComboBox;
1842 private javax.swing.JLabel caseSpecLabel;
1843 private javax.swing.JButton clearAllButton;
1844 private javax.swing.JButton clearInfoButton;
1845 private javax.swing.JButton clearSpecButton;
1846 private javax.swing.JLabel componentsLabel;
1847 private javax.swing.JMenuItem contentsMenuItem;
1848 private javax.swing.JMenuItem copyMenuItem;
1849 private javax.swing.JPanel costPerformancePanel;
1850 private javax.swing.JLabel costperformanceLabel;
1851 private javax.swing.JRadioButton cpuAmdRB;
1852 private javax.swing.ButtonGroup cpuButtonGroup;
1853 private javax.swing.JLabel cpuChoiceLabel;
1854 private javax.swing.ButtonGroup cpuCoolerButtonGroup;
1855 private javax.swing.JRadioButton cpuCoolerHeatsinkRB;
1856 private javax.swing.JLabel cpuCoolerLabel;
1857 private javax.swing.JRadioButton cpuIntelRB;
1858 private javax.swing.JRadioButton cpuWaterCoolerRB;
1859 private javax.swing.JMenuItem cutMenuItem;
1860 private javax.swing.JMenuItem deleteMenuItem;
1861 private javax.swing.JMenu editMenu;
1862 private javax.swing.JMenuItem exitMenuItem;
1863 private javax.swing.JButton exportButton;
1864 private javax.swing.JMenu fileMenu;
1865 private javax.swing.JButton getScoreButton;
1866 private javax.swing.JRadioButton gpuAmdRB;
1867 private javax.swing.ButtonGroup gpuButtonGroup;
1868 private javax.swing.JLabel gpuChoiceLabel;
1869 private javax.swing.JRadioButton gpuNvidiaRB;
1870 private javax.swing.JComboBox<String> heatsinkComboBox;
1871 private javax.swing.JMenu helpMenu;
1872 private javax.swing.JButton highSpecPcButton;
1873 private javax.swing.JLabel highestSpecLabel;
1874 private javax.swing.JButton infoButtonBudget;
1875 private javax.swing.JButton infoButtonCPU;
1876 private javax.swing.JButton infoButtonCPUCooler;
1877 private javax.swing.JButton infoButtonGPU;
1878 private javax.swing.JButton infoButtonStorage;
1879 private javax.swing.JPanel informationPanel;
1880 private javax.swing.JLabel initialInfoLable;
1881 private javax.swing.JComboBox<String> intelCPUComboBox;
1882 private javax.swing.JComboBox<String> intelMotherboardComboBox;
1883 private javax.swing.JMenu jMenu1;
1884 private javax.swing.JMenu jMenu2;
1885 private javax.swing.JScrollPane jScrollPane1;
1886 private javax.swing.JScrollPane jScrollPane2;
1887 private javax.swing.JScrollPane jScrollPane3;
1888 private javax.swing.JButton lowSpecPCButton;
1889 private javax.swing.JLabel lowestSpecLabel;
1890 private javax.swing.JComboBox<String> m2storageComboBox;
1891 private javax.swing.JMenuBar menuBar;
1892 private javax.swing.JLabel motherboardSpecLabel;
1893 private javax.swing.JComboBox<String> nvidiaGPUComboBox;
1894 private javax.swing.JButton okButton;
1895 private javax.swing.JMenuItem openMenuItem;
1896 private javax.swing.JTable partsTable;
1897 private javax.swing.JMenuItem pasteMenuItem;
1898 private javax.swing.JComboBox<String> powersupplyComboBox;
1899 private javax.swing.JButton refreshButton;
1900 private javax.swing.JButton revertButton;
1901 private javax.swing.JMenuItem saveAsMenuItem;
1902 private javax.swing.JButton saveButton;
1903 private javax.swing.JMenuItem saveMenuItem;
1904 private javax.swing.JLabel selectionsLabel;
1905 private javax.swing.JPanel specsPanel;
1906 private javax.swing.JComboBox<String> ssdStorageComboBox;
1907 private javax.swing.ButtonGroup storageButtonGroup;
1908 private javax.swing.JLabel storageChoiceLable;
1909 private javax.swing.JRadioButton storageM2RB;
1910 private javax.swing.JRadioButton storageSSDRB;
1911 private javax.swing.JLabel storageSpecLabel;
1912 private javax.swing.JButton totalCostButton;
1913 private javax.swing.JTable totalCostTable;
1914 private javax.swing.JComboBox<String> watercoolComboBox;
1915 // End of variables declaration
1916
1917 }
1918