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"); } }
public void valueChanged(ListSelectionEvent le) { if (!le.getValueIsAdjusting()) { Kits currentKit = (Kits) kitList.getSelectedValue(); if (currentKit != null) buildKitData(currentKit); } }