Java Code Examples for javax.swing.JComboBox#addPopupMenuListener()
The following examples show how to use
javax.swing.JComboBox#addPopupMenuListener() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConfigurationsComboModel.java From netbeans with Apache License 2.0 | 5 votes |
@Override public void actionPerformed(ActionEvent ae) { JComboBox combo = (JComboBox) ae.getSource(); combo.setEditable(true); combo.getEditor().getEditorComponent().addFocusListener(this); combo.getEditor().getEditorComponent().addKeyListener(this); combo.addPopupMenuListener(this); combo.setSelectedItem(configName == null ? lastSelected + "1" : configName); }
Example 2
Source File: ConfigurationsComboModel.java From netbeans with Apache License 2.0 | 5 votes |
@Override public void actionPerformed(ActionEvent ae) { JComboBox combo = (JComboBox) ae.getSource(); combo.setEditable(true); JTextField editorComponent = (JTextField) combo.getEditor().getEditorComponent(); editorComponent.addFocusListener(this); editorComponent.addKeyListener(this); combo.setSelectedItem(lastSelected); combo.addPopupMenuListener(this); }
Example 3
Source File: ConfigurationsComboModel.java From netbeans with Apache License 2.0 | 5 votes |
@Override public void actionPerformed(ActionEvent ae) { currentActiveItem = this; JComboBox combo = (JComboBox) ae.getSource(); combo.setEditable(true); combo.getEditor().getEditorComponent().addFocusListener(this); combo.getEditor().getEditorComponent().addKeyListener(this); combo.addPopupMenuListener(this); combo.setSelectedItem(configName == null ? lastSelected + "1" : configName); }
Example 4
Source File: ConfigurationsComboModel.java From netbeans with Apache License 2.0 | 5 votes |
@Override public void actionPerformed(ActionEvent ae) { currentActiveItem = this; JComboBox combo = (JComboBox) ae.getSource(); combo.setEditable(true); JTextField editorComponent = (JTextField) combo.getEditor().getEditorComponent(); editorComponent.addFocusListener(this); editorComponent.addKeyListener(this); combo.setSelectedItem(lastSelected); combo.addPopupMenuListener(this); }
Example 5
Source File: DataComboBoxSupport.java From netbeans with Apache License 2.0 | 5 votes |
/** Not private because used in tests. */ DataComboBoxSupport(JComboBox comboBox, DataComboBoxModel dataModel, boolean allowAdding) { this.dataModel = dataModel; this.allowAdding = allowAdding; comboBox.setEditable(false); comboBox.setModel(new ItemComboBoxModel()); comboBox.setRenderer(new ItemListCellRenderer()); comboBox.addActionListener(new ItemActionListener()); comboBox.addPopupMenuListener(new ItemPopupMenuListener()); }