FactoryManagerGUI(FactoryManager parent, int pWidth, int pHeight) { this.parent = parent; this.PAGE_WIDTH = pWidth; this.PAGE_HEIGHT = pHeight; // initialize class variables activeKitsContainer = new JPanel(); activeKitsPanel = new JPanel(); kitDataPanel = new JPanel(); kits = new TreeMap<Integer, Kits>(); buildInfo = new ArrayList<Kits>(); images = parent.getImageArray(); greyLine = BorderFactory.createLineBorder(Color.DARK_GRAY); // build Active Kits Container activeKitsContainer.setLayout(new BoxLayout(activeKitsContainer, BoxLayout.X_AXIS)); setComponentSize(activeKitsContainer, PAGE_WIDTH, PAGE_HEIGHT); setComponentSize(kitDataPanel, 450, PAGE_HEIGHT); buildActiveKits(activeKitsPanel); activeKitsContainer.add(activeKitsPanel); activeKitsContainer.add(kitDataPanel); // add master containers to frame this.add(activeKitsContainer); }
public void actionPerformed(ActionEvent ae) { try { String sbuildQuantity = buildQuantity.getText(); System.out.println(sbuildQuantity); int buildNumber = Integer.parseInt(sbuildQuantity); if (buildNumber <= 0) { System.out.println("Invalid kit build amount"); } else { Kits selectedKit = (Kits) kitList.getSelectedValue(); selectedKit.setBuildNumber(buildNumber); buildInfo.add(selectedKit); parent.syncBuildInfo(buildInfo); } } catch (Exception e) { System.out.println("Invalid kit build amount"); } }