MechSummary ms = m_mechsCurrent[m_mechList.getSelectedIndex()]; try { Entity entity = new MechFileParser(ms.getSourceFile(), ms.getEntryName()).getEntity(); MechView mechView = new MechView(entity); m_mechViewLeft.setEditable(false); m_mechViewRight.setEditable(false); m_mechViewLeft.setText(mechView.getMechReadoutBasic()); m_mechViewRight.setText(mechView.getMechReadoutLoadout()); m_mechViewLeft.setCaretPosition(0); m_mechViewRight.setCaretPosition(0); } catch (EntityLoadingException ex) { System.out.println("Unable to load mech: " + ms.getSourceFile() + ": " + ms.getEntryName() + ": " + ex.getMessage()); ex.printStackTrace();
int selected = m_mechList.getSelectedIndex(); if (selected == -1) { clearMechPreview();
    public void itemStateChanged(ItemEvent ie)    {        if (ie.getSource() == m_chSort) {            sortMechs();        }        else if (ie.getSource() == m_chWeightClass || ie.getSource() == m_chType || ie.getSource() == m_chUnitType) {            filterMechs();        } else if (ie.getSource() == m_mechList) {            MechSummary ms = m_mechsCurrent[m_mechList.getSelectedIndex()];            try {                Entity entity = new MechFileParser(ms.getSourceFile(), ms.getEntryName()).getEntity();                MechView mechView = new MechView(entity);		m_mechViewLeft.setEditable(false);		m_mechViewRight.setEditable(false);		m_mechViewLeft.setText(mechView.getMechReadoutBasic());		m_mechViewRight.setText(mechView.getMechReadoutLoadout());                m_mechViewLeft.setCaretPosition(0);                m_mechViewRight.setCaretPosition(0);            } catch (EntityLoadingException ex) {                System.out.println("Unable to load mech: " + ms.getSourceFile() + ": " + ms.getEntryName() + ": " + ex.getMessage());                ex.printStackTrace();                return;            }        }    }