Search in sources :

Example 1 with RosterGroupComboBox

use of jmri.jmrit.roster.swing.RosterGroupComboBox in project JMRI by JMRI.

the class RosterGroupTableAction method actionPerformed.

public void actionPerformed() {
    // create the JTable model, with changes for specific NamedBean
    createModel();
    // create the frame
    f = new RosterGroupTableFrame(m, helpTarget()) {

        /**
             * Include an "add" button
             */
        @Override
        void extras() {
            final JComboBox<String> selectCombo = new RosterGroupComboBox();
            selectCombo.insertItemAt("", 0);
            selectCombo.setSelectedIndex(-1);
            JPanel p25 = new JPanel();
            p25.add(new JLabel(Bundle.getMessage("SelectRosterGroup")));
            p25.add(selectCombo);
            addToTopBox(p25);
            selectCombo.addActionListener(new ActionListener() {

                @Override
                public void actionPerformed(ActionEvent e) {
                    comboSelected(e, selectCombo.getSelectedItem().toString());
                }
            });
            selectCombo.setVisible(true);
        }
    };
    setTitle();
    addToFrame(f);
    f.pack();
    f.setVisible(true);
}
Also used : JPanel(javax.swing.JPanel) JComboBox(javax.swing.JComboBox) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) RosterGroupComboBox(jmri.jmrit.roster.swing.RosterGroupComboBox) JLabel(javax.swing.JLabel)

Aggregations

ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 JComboBox (javax.swing.JComboBox)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 RosterGroupComboBox (jmri.jmrit.roster.swing.RosterGroupComboBox)1