public class BasicComboBoxEditor extends Object implements ComboBoxEditor, FocusListener
The default editor for editable combo boxes. The editor is implemented as a JTextField.
Modifier and Type | Class and Description |
---|---|
static class |
BasicComboBoxEditor.UIResource A subclass of BasicComboBoxEditor that implements UIResource. |
protected JTextField editor
public BasicComboBoxEditor()
public Component getEditorComponent()
Description copied from interface: ComboBoxEditor
Return the component that should be added to the tree hierarchy for this editor
getEditorComponent
in interface ComboBoxEditor
protected JTextField createEditorComponent()
Creates the internal editor component. Override this to provide a custom implementation.
public void setItem(Object anObject)
Sets the item that should be edited.
setItem
in interface ComboBoxEditor
anObject
- the displayed value of the editorpublic Object getItem()
Description copied from interface: ComboBoxEditor
Return the edited item
getItem
in interface ComboBoxEditor
public void selectAll()
Description copied from interface: ComboBoxEditor
Ask the editor to start editing and to select everything
selectAll
in interface ComboBoxEditor
public void focusGained(FocusEvent e)
Description copied from interface: FocusListener
Invoked when a component gains the keyboard focus.
focusGained
in interface FocusListener
public void focusLost(FocusEvent e)
Description copied from interface: FocusListener
Invoked when a component loses the keyboard focus.
focusLost
in interface FocusListener
public void addActionListener(ActionListener l)
Description copied from interface: ComboBoxEditor
Add an ActionListener. An action event is generated when the edited item changes
addActionListener
in interface ComboBoxEditor
public void removeActionListener(ActionListener l)
Description copied from interface: ComboBoxEditor
Remove an ActionListener
removeActionListener
in interface ComboBoxEditor
© 1993–2017, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.