Search in sources :

Example 41 with DefaultListModel

use of javax.swing.DefaultListModel in project processdash by dtuma.

the class TeamProjectBrowser method buildScriptList.

private void buildScriptList() {
    scripts = new DefaultListModel();
    scriptList = new ScriptList(scripts);
    scriptList.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    scriptList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    scriptList.addMouseListener(new ListClickHandler());
    scriptList.getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "showScript");
    scriptList.getActionMap().put("showScript", new ListEnterAction());
    setRightComponent(new JScrollPane(scriptList));
}
Also used : JScrollPane(javax.swing.JScrollPane) DefaultListModel(javax.swing.DefaultListModel)

Aggregations

DefaultListModel (javax.swing.DefaultListModel)41 JList (javax.swing.JList)21 ArrayList (java.util.ArrayList)16 JScrollPane (javax.swing.JScrollPane)13 List (java.util.List)8 JButton (javax.swing.JButton)8 ActionEvent (java.awt.event.ActionEvent)5 ActionListener (java.awt.event.ActionListener)5 JPanel (javax.swing.JPanel)5 Conditional (jmri.Conditional)5 Dimension (java.awt.Dimension)4 GridBagConstraints (java.awt.GridBagConstraints)4 GridBagLayout (java.awt.GridBagLayout)4 Insets (java.awt.Insets)4 Logix (jmri.Logix)4 Component (java.awt.Component)3 JLabel (javax.swing.JLabel)3 SensorGroupConditional (jmri.implementation.SensorGroupConditional)3 FormBuilder (com.jgoodies.forms.builder.FormBuilder)2 FormLayout (com.jgoodies.forms.layout.FormLayout)2