weaponList = new List(4, false); weaponList.addItemListener(this);
weaponList = new JList(new DefaultListModel()); weaponList.addListSelectionListener(this);
        WeaponPanel() {            super(new GridBagLayout());            // weapon list            weaponList = new List(4, false);            weaponList.addItemListener(this);            weaponList.addKeyListener(clientgui.menuBar);            // layout main panel            GridBagConstraints c = new GridBagConstraints();            //adding Weapon List            c.fill = GridBagConstraints.BOTH;            c.insets = new Insets(15, 9, 1, 9);            c.weightx = 0.0;            c.weighty = 1.0;            c.gridx = 0;            c.gridy = 0;            c.gridwidth = GridBagConstraints.REMAINDER;            ((GridBagLayout) getLayout()).setConstraints(weaponList, c);            add(weaponList);            //adding Ammo choice + label            wAmmo = new JLabel(Messages.getString("MechDisplay.Ammo"), JLabel.LEFT); //$NON-NLS-1$            wAmmo.setOpaque(true);            m_chAmmo = new JComboBox();            m_chAmmo.addItemListener(this);            m_chAmmo.addKeyListener(clientgui.menuBar);            c.insets = new Insets(1, 9, 1, 1);            c.gridwidth = 1;            c.weighty = 0.0;            c.fill = GridBagConstraints.NONE;            c.gridx = 0;            c.gridy = 1;            ((GridBagLayout) getLayout()).setConstraints(wAmmo, c);            add(wAmmo);            c.insets = new Insets(1, 1, 1, 9);            c.gridwidth = GridBagConstraints.REMAINDER;            c.gridx = 1;            c.gridy = 1;            c.fill = GridBagConstraints.HORIZONTAL;            ((GridBagLayout) getLayout()).setConstraints(m_chAmmo, c);            add(m_chAmmo);            //Adding Heat Buildup            currentHeatBuildupL = new JLabel(Messages.getString("MechDisplay.HeatBuildup"), JLabel.RIGHT); //$NON-NLS-1$            currentHeatBuildupL.setOpaque(false);            currentHeatBuildupR = new JLabel("--", JLabel.LEFT); //$NON-NLS-1$            currentHeatBuildupR.setOpaque(false);            c.insets = new Insets(2, 9, 2, 1);            c.gridwidth = 2;            c.gridx = 0;            c.gridy = 2;            c.fill = GridBagConstraints.NONE;            c.anchor = GridBagConstraints.EAST;            ((GridBagLayout) getLayout()).setConstraints(currentHeatBuildupL, c);            add(currentHeatBuildupL);            c.insets = new Insets(2, 1, 2, 9);            c.gridwidth = GridBagConstraints.REMAINDER;            c.gridx = 2;            c.anchor = GridBagConstraints.WEST;            //c.fill = GridBagConstraints.HORIZONTAL;            ((GridBagLayout) getLayout()).setConstraints(currentHeatBuildupR, c);            add(currentHeatBuildupR);            //Adding weapon display labels            wNameL = new JLabel(Messages.getString("MechDisplay.Name"), JLabel.CENTER); //$NON-NLS-1$            wNameL.setOpaque(true);            wHeatL = new JLabel(Messages.getString("MechDisplay.Heat"), JLabel.CENTER); //$NON-NLS-1$            wHeatL.setOpaque(true);            wDamL = new JLabel(Messages.getString("MechDisplay.Damage"), JLabel.CENTER); //$NON-NLS-1$            wDamL.setOpaque(true);            wNameR = new JLabel("", JLabel.CENTER); //$NON-NLS-1$            wNameR.setOpaque(false);            wHeatR = new JLabel("--", JLabel.CENTER); //$NON-NLS-1$            wHeatR.setOpaque(false);            wDamR = new JLabel("--", JLabel.CENTER); //$NON-NLS-1$            wDamR.setOpaque(false);            c.anchor = GridBagConstraints.CENTER;            c.fill = GridBagConstraints.BOTH;            c.insets = new Insets(2, 9, 1, 1);            c.gridwidth = 2;            c.gridx = 0;            c.gridy = 3;            ((GridBagLayout) getLayout()).setConstraints(wNameL, c);            add(wNameL);            c.insets = new Insets(2, 1, 1, 1);            c.gridwidth = 1;            c.gridx = 2;            ((GridBagLayout) getLayout()).setConstraints(wHeatL, c);            add(wHeatL);            c.insets = new Insets(2, 1, 1, 9);            c.gridwidth = GridBagConstraints.REMAINDER;            c.gridx = 3;            ((GridBagLayout) getLayout()).setConstraints(wDamL, c);            add(wDamL);            c.insets = new Insets(1, 9, 2, 1);            c.gridwidth = 2;            c.gridx = 0;            c.gridy = 4;            ((GridBagLayout) getLayout()).setConstraints(wNameR, c);            add(wNameR);            c.gridwidth = 1;            c.gridx = 2;            ((GridBagLayout) getLayout()).setConstraints(wHeatR, c);            add(wHeatR);            c.insets = new Insets(1, 1, 2, 9);            c.gridx = 3;            c.gridwidth = GridBagConstraints.REMAINDER;            ((GridBagLayout) getLayout()).setConstraints(wDamR, c);            add(wDamR);            // Adding range labels            wMinL = new JLabel(Messages.getString("MechDisplay.Min"), JLabel.CENTER); //$NON-NLS-1$            wMinL.setOpaque(true);            wShortL = new JLabel(Messages.getString("MechDisplay.Short"), JLabel.CENTER); //$NON-NLS-1$            wShortL.setOpaque(true);            wMedL = new JLabel(Messages.getString("MechDisplay.Med"), JLabel.CENTER); //$NON-NLS-1$            wMedL.setOpaque(true);            wLongL = new JLabel(Messages.getString("MechDisplay.Long"), JLabel.CENTER); //$NON-NLS-1$            wLongL.setOpaque(true);            wExtL = new JLabel(Messages.getString("MechDisplay.Ext"), JLabel.CENTER); //$NON-NLS-1$            wExtL.setOpaque(true);            wMinR = new JLabel("---", JLabel.CENTER); //$NON-NLS-1$            wMinR.setOpaque(true);            wShortR = new JLabel("---", JLabel.CENTER); //$NON-NLS-1$            wShortR.setOpaque(true);            wMedR = new JLabel("---", JLabel.CENTER); //$NON-NLS-1$            wMedR.setOpaque(true);            wLongR = new JLabel("---", JLabel.CENTER); //$NON-NLS-1$            wLongR.setOpaque(true);            wExtR = new JLabel("---", JLabel.CENTER); //$NON-NLS-1$            wExtR.setOpaque(true);            c.weightx = 1.0;            c.insets = new Insets(2, 9, 1, 1);            c.gridx = 0;            c.gridy = 5;            c.gridwidth = 1;            ((GridBagLayout) getLayout()).setConstraints(wMinL, c);            add(wMinL);            c.insets = new Insets(2, 1, 1, 1);            c.gridx = 1;            c.gridy = 5;            ((GridBagLayout) getLayout()).setConstraints(wShortL, c);            add(wShortL);            c.gridx = 2;            c.gridy = 5;            ((GridBagLayout) getLayout()).setConstraints(wMedL, c);            add(wMedL);        //         c.insets = new Insets(2, 1, 1, 9);            c.gridx = 3;            c.gridy = 5;//  c.gridwidth = GridBagConstraints.REMAINDER;            ((GridBagLayout) getLayout()).setConstraints(wLongL, c);            add(wLongL);            c.insets = new Insets(2, 1, 1, 9);            c.gridx = 4;            c.gridy = 5;            c.gridwidth = GridBagConstraints.REMAINDER;            ((GridBagLayout) getLayout()).setConstraints(wExtL, c);            add(wExtL);            //----------------            c.insets = new Insets(1, 9, 2, 1);            c.gridx = 0;            c.gridy = 6;            c.gridwidth = 1;            ((GridBagLayout) getLayout()).setConstraints(wMinR, c);            add(wMinR);            c.insets = new Insets(1, 1, 2, 1);            c.gridx = 1;            c.gridy = 6;            ((GridBagLayout) getLayout()).setConstraints(wShortR, c);            add(wShortR);            c.gridx = 2;            c.gridy = 6;            ((GridBagLayout) getLayout()).setConstraints(wMedR, c);            add(wMedR);//         c.insets = new Insets(1, 1, 2, 9);            c.gridx = 3;            c.gridy = 6;//  c.gridwidth = GridBagConstraints.REMAINDER;            ((GridBagLayout) getLayout()).setConstraints(wLongR, c);            add(wLongR);            c.insets = new Insets(1, 1, 2, 9);            c.gridx = 4;            c.gridy = 6;            ((GridBagLayout) getLayout()).setConstraints(wExtR, c);            add(wExtR);            // target panel            wTargetL = new JLabel(Messages.getString("MechDisplay.Target"), JLabel.CENTER); //$NON-NLS-1$            wTargetL.setOpaque(true);            wRangeL = new JLabel(Messages.getString("MechDisplay.Range"), JLabel.CENTER); //$NON-NLS-1$            wRangeL.setOpaque(true);            wToHitL = new JLabel(Messages.getString("MechDisplay.ToHit"), JLabel.CENTER); //$NON-NLS-1$            wToHitL.setOpaque(true);            wTargetR = new JLabel("---", JLabel.CENTER); //$NON-NLS-1$            wTargetR.setOpaque(true);            wRangeR = new JLabel("---", JLabel.CENTER); //$NON-NLS-1$            wRangeR.setOpaque(true);            wToHitR = new JLabel("---", JLabel.CENTER); //$NON-NLS-1$            wToHitR.setOpaque(true);            c.weightx = 0.0;            c.insets = new Insets(2, 9, 1, 1);            c.gridx = 0;            c.gridy = 7;            c.gridwidth = 1;            ((GridBagLayout) getLayout()).setConstraints(wTargetL, c);            add(wTargetL);            c.insets = new Insets(2, 1, 1, 9);            c.gridx = 1;            c.gridy = 7;            c.gridwidth = GridBagConstraints.REMAINDER;            ((GridBagLayout) getLayout()).setConstraints(wTargetR, c);            add(wTargetR);            c.insets = new Insets(1, 9, 1, 1);            c.gridx = 0;            c.gridy = 8;            c.gridwidth = 1;            ((GridBagLayout) getLayout()).setConstraints(wRangeL, c);            add(wRangeL);            c.insets = new Insets(1, 1, 1, 9);            c.gridx = 1;            c.gridy = 8;            c.gridwidth = GridBagConstraints.REMAINDER;            ((GridBagLayout) getLayout()).setConstraints(wRangeR, c);            add(wRangeR);            c.insets = new Insets(1, 9, 1, 1);            c.gridx = 0;            c.gridy = 9;            c.gridwidth = 1;            ((GridBagLayout) getLayout()).setConstraints(wToHitL, c);            add(wToHitL);            c.insets = new Insets(1, 1, 1, 9);            c.gridx = 1;            c.gridy = 9;            c.gridwidth = GridBagConstraints.REMAINDER;            ((GridBagLayout) getLayout()).setConstraints(wToHitR, c);            add(wToHitR);            // to-hit text            toHitText = new JTextArea("", 2, 20); //$NON-NLS-1$            toHitText.setEditable(false);            toHitText.addKeyListener(clientgui.menuBar);            c.insets = new Insets(1, 9, 15, 9);            c.gridx = 0;            c.gridy = 10;            c.gridwidth = GridBagConstraints.REMAINDER;            ((GridBagLayout) getLayout()).setConstraints(toHitText, c);            add(toHitText);            setBackGround();        }