FocusListener
, EventListener
, ComboBoxEditor
BasicComboBoxEditor.UIResource
, MetalComboBoxEditor
public class BasicComboBoxEditor extends Object implements ComboBoxEditor, FocusListener
Modifier and Type | Class | Description |
---|---|---|
static class |
BasicComboBoxEditor.UIResource |
A subclass of BasicComboBoxEditor that implements UIResource.
|
Modifier and Type | Field | Description |
---|---|---|
protected JTextField |
editor |
An instance of
JTextField . |
Constructor | Description |
---|---|
BasicComboBoxEditor() |
Constructs a new instance of
BasicComboBoxEditor . |
Modifier and Type | Method | Description |
---|---|---|
void |
addActionListener(ActionListener l) |
Add an ActionListener.
|
protected JTextField |
createEditorComponent() |
Creates the internal editor component.
|
void |
focusGained(FocusEvent e) |
Invoked when a component gains the keyboard focus.
|
void |
focusLost(FocusEvent e) |
Invoked when a component loses the keyboard focus.
|
Component |
getEditorComponent() |
Returns the component that should be added to the tree hierarchy for
this editor
|
Object |
getItem() |
Returns the edited item
|
void |
removeActionListener(ActionListener l) |
Remove an ActionListener
|
void |
selectAll() |
Ask the editor to start editing and to select everything
|
void |
setItem(Object anObject) |
Sets the item that should be edited.
|
protected JTextField editor
JTextField
.public BasicComboBoxEditor()
BasicComboBoxEditor
.public Component getEditorComponent()
ComboBoxEditor
getEditorComponent
in interface ComboBoxEditor
protected JTextField createEditorComponent()
public void setItem(Object anObject)
setItem
in interface ComboBoxEditor
anObject
- the displayed value of the editorpublic Object getItem()
ComboBoxEditor
getItem
in interface ComboBoxEditor
public void selectAll()
ComboBoxEditor
selectAll
in interface ComboBoxEditor
public void focusGained(FocusEvent e)
FocusListener
focusGained
in interface FocusListener
e
- the event to be processedpublic void focusLost(FocusEvent e)
FocusListener
focusLost
in interface FocusListener
e
- the event to be processedpublic void addActionListener(ActionListener l)
ComboBoxEditor
addActionListener
in interface ComboBoxEditor
l
- an ActionListener
public void removeActionListener(ActionListener l)
ComboBoxEditor
removeActionListener
in interface ComboBoxEditor
l
- an ActionListener
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2017, Oracle and/or its affiliates. 500 Oracle Parkway
Redwood Shores, CA 94065 USA. All rights reserved.
DRAFT 9-internal+0-adhoc.mlchung.jdk9-jdeps