if (getShowAsFormComponent()) { if (hidden) syncSelection();  if (sel < 0) { hidden = true; fireEvents(); } else { selection[sel] = true; hidden = false; } } else { if (isSelectedIndex(sel)) removeSelectionInterval(sel, sel); else addSelectionInterval(sel, sel); }
setSelectedIndex(sel);
    public void getPerformed(String action, String value) {        try {            int sel = Integer.parseInt(value);            if (getShowAsFormComponent()) {                if (hidden)                    syncSelection();                                if (sel < 0) {                    hidden = true;                    fireEvents();                }                else {                    selection[sel] = true;                    hidden = false;                }            }            else {                if (isSelectedIndex(sel))                    removeSelectionInterval(sel, sel);                else                    addSelectionInterval(sel, sel);            }        }        catch (Exception e) {            System.err.println("Cannot parse expected integer");            e.printStackTrace();        }    }