lisEntities = new List(10); lisEntities.addActionListener(this); lisEntities.addItemListener(this);
lisEntities = new JList(new DefaultListModel()); lisEntities.addListSelectionListener(this);
    private void setupEntities() {        lisEntities = new List(10);        lisEntities.addActionListener(this);        lisEntities.addItemListener(this);        butLoadList = new JButton(Messages.getString("ChatLounge.butLoadList")); //$NON-NLS-1$        butLoadList.setActionCommand("load_list"); //$NON-NLS-1$        butLoadList.addActionListener(this);        //          lblPlaceholder = new JLabel();        butSaveList = new JButton(Messages.getString("ChatLounge.butSaveList")); //$NON-NLS-1$        butSaveList.setActionCommand("save_list"); //$NON-NLS-1$        butSaveList.addActionListener(this);        butSaveList.setEnabled(false);        butLoad = new JButton(Messages.getString("ChatLounge.butLoad")); //$NON-NLS-1$        butLoadCustomBA = new JButton(Messages.getString("ChatLounge.butLoadCustomBA"));        MechSummaryCache mechSummaryCache = MechSummaryCache.getInstance();        mechSummaryCache.addListener(mechSummaryCacheListener);        butLoad.setEnabled(mechSummaryCache.isInitialized());        butLoadCustomBA.setEnabled(mechSummaryCache.isInitialized());        Font font = new Font("sanserif", Font.BOLD, 18); //$NON-NLS-1$        if (null == font) {            System.err.println("Couldn't find the new font for the 'Add a Unit' button."); //$NON-NLS-1$        } else {            butLoad.setFont(font);        }        butLoad.setActionCommand("load_mech"); //$NON-NLS-1$        butLoad.addActionListener(this);        butLoadCustomBA.setActionCommand("load_custom_ba"); //$NON-NLS-1$        butLoadCustomBA.addActionListener(this);        butCustom = new JButton(Messages.getString("ChatLounge.butCustom")); //$NON-NLS-1$        butCustom.setActionCommand("custom_mech"); //$NON-NLS-1$        butCustom.addActionListener(this);        butCustom.setEnabled(false);        butMechReadout = new JButton(Messages.getString("ChatLounge.butMechReadout")); //$NON-NLS-1$        butMechReadout.setActionCommand("Mech_readout"); //$NON-NLS-1$        butMechReadout.addActionListener(this);        butMechReadout.setEnabled(false);        butViewGroup = new JButton(Messages.getString("ChatLounge.butViewGroup")); //$NON-NLS-1$        butViewGroup.setActionCommand("view_group"); //$NON-NLS-1$        butViewGroup.addActionListener(this);        butViewGroup.setEnabled(false);        butDelete = new JButton(Messages.getString("ChatLounge.butDelete")); //$NON-NLS-1$        butDelete.setActionCommand("delete_mech"); //$NON-NLS-1$        butDelete.addActionListener(this);        butDelete.setEnabled(false);        butDeleteAll = new JButton(Messages.getString("ChatLounge.butDeleteAll")); //$NON-NLS-1$        butDeleteAll.setActionCommand("delete_all"); //$NON-NLS-1$        butDeleteAll.addActionListener(this);        butDeleteAll.setEnabled(false);        panEntities = new JPanel();        // layout        GridBagLayout gridbag = new GridBagLayout();        GridBagConstraints c = new GridBagConstraints();        panEntities.setLayout(gridbag);        c.fill = GridBagConstraints.BOTH;        c.insets = new Insets(1, 1, 1, 1);        c.weightx = 1.0;        c.weighty = 1.0;        c.gridwidth = GridBagConstraints.REMAINDER;        gridbag.setConstraints(lisEntities, c);        panEntities.add(lisEntities);        c.weightx = 1.0;        c.weighty = 0.0;        c.gridwidth = 1;        c.gridheight = 2;        gridbag.setConstraints(butLoad, c);        panEntities.add(butLoad);        c.gridheight = 1;        gridbag.setConstraints(butCustom, c);        panEntities.add(butCustom);        gridbag.setConstraints(butLoadList, c);        panEntities.add(butLoadList);        gridbag.setConstraints(butMechReadout, c);        panEntities.add(butMechReadout);        c.weightx = 1.0;        c.weighty = 0.0;        c.gridwidth = GridBagConstraints.REMAINDER;        gridbag.setConstraints(butDelete, c);        panEntities.add(butDelete);        c.gridwidth = 1;        c.gridy = GridBagConstraints.RELATIVE;        gridbag.setConstraints(butLoadCustomBA, c);        panEntities.add(butLoadCustomBA);        //          c.gridwidth = 1;        //          gridbag.setConstraints( lblPlaceholder, c );        //          panEntities.add( lblPlaceholder );        c.gridwidth = 1;        gridbag.setConstraints(butSaveList, c);        panEntities.add(butSaveList);        c.gridwidth = 1;        gridbag.setConstraints(butViewGroup, c);        panEntities.add(butViewGroup);        c.gridwidth = 1;        gridbag.setConstraints(butDeleteAll, c);        panEntities.add(butDeleteAll);    }