MyRenderer.java
implements a custom combo box renderer that
supports images. ComboExample.java
uses the renderer in a JComboBox. Images from the
images
directory are used.
Combo Box Editor
AddFieldEditor.java
implements a custom combo box editor that adds
items to the list of choices. AddExample.java
uses the editor in a JComboBox. Updated to fix an
error in the getItem method. This method should
return retVal
not curItem.
Complete Combo Box Example
SimpleRenderer.java
implements a custom combo box renderer that
supports fonts. JumptoFieldEditor.java
implements a custom combo box editor that tries
to fill in the users typing based on available
choices. JumptoExample.java
uses the renderer and editor in a JComboBox. The
editor was updated to fix an error in the getItem
method. This method should return retVal
not curItem.
The editor was also updated to fix a new semantic
that caused getSelectedItem
to return the item being edited but not yet
added.
Item Listener
Choices.java
uses an ItemListener to receive notifications
when the selection in a JComboBox changes.