Searchable Combobox


This extension provides developers with the ULCSearchableComboBox component. This class extends ULCComboBox and allows selection from the drop-down list of an item that matches the string typed by the user. The ComboBox gives visual feedback if none of the items in the drop-down list match the string being typed by the user.


How to use

The following shows a sample use of the ULCSearchableComboBox component:


List list = new ArrayList(); list.add("ULCLabel"); list.add("ULCTextField"); list.add("ULCAbstractButton"); list.add("ULCButton"); list.add("ULCButtonGroup"); list.add("ULCCheckBox"); list.add("ULCDesktopPane"); ULCSearchableComboBox searchableComboBox = new ULCSearchableComboBox(list);


How it is implemented

The UISearchableComboBox class serves as a proxy to the ULCSearchableComboBox class on the server side. It acts as a KeyListener to the JTextField editor of the underlying JComboBox. On each key stroke, the string in the editor is matched with the strings in the drop-down item list and the first matching string is selected.