String cur = items.getSelectedItem();
String cur = (String) items.getSelectedValue();
    public void setItemName(String item) {        // Do nothing is we're passed a null.        if (item != null) {            // Get the current selection.            String cur = items.getSelectedItem();            // Do nothing, if the request is for the selected item.            if (!item.equals(cur)) {                // Try to find the requested item.                String[] contents = items.getItems();                for (int loop = 0; loop < items.getItemCount(); loop++) {                    // Did we find it?                    if (contents[loop].equals(item)) {                        // Select this position.                        items.select(loop);                        // Stop looking for the item.                        break;                    } // End found-requested-item                } // Check the next item            } // End new-selection        } // End not-passed-null    }