String curItem = items.getSelectedItem();
String curItem = (String) items.getSelectedValue();
    public void actionPerformed(ActionEvent event) {        // Did the worker change their selection?        String curCat = (String) categories.getSelectedItem();        String curItem = items.getSelectedItem();        if (!curCat.equals(prevCat) || !curItem.equals(prevItem)) {            // Save the new values.            setPrevSelection(curCat, curItem);            // Are there any listeners?            if (!listeners.isEmpty()) {                // Get the Image.                Image image = null;                Image[] array = (Image[]) getSelectedObjects();                if (array != null) image = array[0];                // Create an ItemEvent for the change.                ItemEvent alert = new ItemEvent                        (this, event.getID(), image, ItemEvent.ITEM_STATE_CHANGED);                // Alert the listeners.                Enumeration alerts = listeners.elements();                while (alerts.hasMoreElements()) {                    ((ItemListener) alerts.nextElement())                            .itemStateChanged(alert);                }            } // End have-listeners        } // End selection-changed        // Now exit.        close();    }