List of usage examples for javax.swing DefaultComboBoxModel addListDataListener
void addListDataListener(ListDataListener l);
From source file:org.pentaho.reporting.ui.datasources.sequence.SequenceEditor.java
public SequenceEditor() { registry = new SequenceRegistry(); setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); final DefaultComboBoxModel groupModel = new DefaultComboBoxModel( registry.getSequenceGroups(Locale.getDefault())); groupModel.addListDataListener(new SelectGroupAction()); sequenceGroupBox = new JComboBox(); sequenceGroupBox.setModel(groupModel); sequenceModel = new KeyedComboBoxModel<Sequence, String>(); sequenceModel.addListDataListener(new SequenceSelectionHandler()); sequenceNameBox = new JComboBox(sequenceModel); propertyTableModel = new SequencePropertyTableModel(); propertyTable = new PropertyTable(); propertyTable.setModel(propertyTableModel); final JPanel headerPanel = new JPanel(); headerPanel.setLayout(new VerticalLayout(5, VerticalLayout.BOTH)); headerPanel.add(new JLabel(Messages.getString("SequenceEditor.Group"))); headerPanel.add(sequenceGroupBox);//from www .ja v a2s. c om headerPanel.add(new JLabel(Messages.getString("SequenceEditor.Sequence"))); headerPanel.add(sequenceNameBox); setLayout(new BorderLayout()); add(new JScrollPane(propertyTable), BorderLayout.CENTER); add(headerPanel, BorderLayout.NORTH); setSequence(null); }