public class

BasicComboBoxEditor

extends Object
implements FocusListener ComboBoxEditor
java.lang.Object
   ↳ javax.swing.plaf.basic.BasicComboBoxEditor
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

The default editor for editable combo boxes. The editor is implemented as a JTextField.

Summary

Nested Classes
class BasicComboBoxEditor.UIResource A subclass of BasicComboBoxEditor that implements UIResource. 
Fields
protected JTextField editor
Public Constructors
BasicComboBoxEditor()
Public Methods
void addActionListener(ActionListener l)
Add an ActionListener.
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()
Return the component that should be added to the tree hierarchy for this editor
Object getItem()
Return 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 Methods
JTextField createEditorComponent()
Creates the internal editor component.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.awt.event.FocusListener
From interface javax.swing.ComboBoxEditor

Fields

protected JTextField editor

Public Constructors

public BasicComboBoxEditor ()

Public Methods

public void addActionListener (ActionListener l)

Add an ActionListener. An action event is generated when the edited item changes

public void focusGained (FocusEvent e)

Invoked when a component gains the keyboard focus.

public void focusLost (FocusEvent e)

Invoked when a component loses the keyboard focus.

public Component getEditorComponent ()

Return the component that should be added to the tree hierarchy for this editor

public Object getItem ()

Return the edited item

public void removeActionListener (ActionListener l)

Remove an ActionListener

public void selectAll ()

Ask the editor to start editing and to select everything

public void setItem (Object anObject)

Sets the item that should be edited.

Parameters
anObject the displayed value of the editor

Protected Methods

protected JTextField createEditorComponent ()

Creates the internal editor component. Override this to provide a custom implementation.

Returns
  • a new editor component