m_chMode.select(m.curMode());
    public void itemStateChanged(ItemEvent ev) {        if(ev.getItemSelectable() == locList) {            displaySlots();        }        else if (ev.getItemSelectable() == slotList) {            m_bDumpAmmo.setEnabled(false);            m_chMode.setEnabled(false);            modeLabel.setEnabled(false);            Mounted m = getSelectedEquipment();                      boolean bOwner = (client.getLocalPlayer() == en.getOwner());            if (m != null && bOwner && m.getType() instanceof AmmoType                     && m.getShotsLeft() > 0 && !m.isDumping()) {                m_bDumpAmmo.setEnabled(true);            }            else if (m != null && bOwner && m.getType().hasModes()) {                m_chMode.setEnabled(true);                modeLabel.setEnabled(true);                m_chMode.removeAll();                String[] saModes = m.getType().getModes();                for (int x = 0; x < saModes.length; x++) {                    m_chMode.add(saModes[x]);                }            }        }        else if (ev.getItemSelectable() == m_chMode) {            Mounted m = getSelectedEquipment();            if (m != null && m.getType().hasModes()) {                int nMode = m.setMode(m_chMode.getSelectedItem());                                        // send the event to the server                client.sendModeChange(en.getId(), en.getEquipmentNum(m), nMode);                                    // notify the player                if (m.getType().hasInstantModeSwitch()) {                    client.cb.systemMessage("Switched " + m.getName() + " to " + m.curMode());                }                else {                    client.cb.systemMessage(m.getName() + " will switch to " + m.pendingMode() +                             " at end of turn.");                }                displaySlots();            }        }    }