String curCat = (String) categories.getSelectedItem();   if (Player.NO_CAMO.equals(curCat)) { select.setIcon(null); select.setBackground (PlayerColors.getColor(items.getSelectedIndex())); return; }   if (Player.ROOT_CAMO.equals(curCat)) { curCat = ""; }   try { select.setBackground(categories.getBackground()); Image img = (Image) camos.getItem(curCat, items.getSelectedItem()); if (img != null) { select.setIcon(new ImageIcon(img)); } else { select.setIcon(null); } } catch (Exception err) {  err.printStackTrace(); AlertDialog dlg = new AlertDialog (frame, Messages.getString("CamoChoiceDialog.error_getting_camo"), err.getMessage()); dlg.setVisible(true); dlg.dispose(); }
updateButton();
    public void itemStateChanged(ItemEvent event) {        // Get the category and the index of the selected item.        String curCat = (String) categories.getSelectedItem();        // If a "no camo" item is selected, clear the image.        if (Player.NO_CAMO.equals(curCat)) {            select.setIcon(null);            select.setBackground                    (PlayerColors.getColor(items.getSelectedIndex()));            return;        }        // Replace the ROOT_CAMO string with "".        if (Player.ROOT_CAMO.equals(curCat)) {            curCat = ""; //$NON-NLS-1$        }        // Clear the background and try to set the camo image.        try {            select.setBackground(categories.getBackground());            Image img = (Image) camos.getItem(curCat, items.getSelectedItem());            if (img != null) {                select.setIcon(new ImageIcon(img));            } else {                select.setIcon(null);            }        } catch (Exception err) {            // Print the stack trace and display the message.            err.printStackTrace();            AlertDialog dlg = new AlertDialog                    (frame, Messages.getString("CamoChoiceDialog.error_getting_camo"), err.getMessage()); //$NON-NLS-1$            dlg.setVisible(true);            dlg.dispose();        }    }