The choice sample is a list box using the JFChoice class. The choice sample uses the following classes:
JFChoice
JFFieldLong
Figure 1.6 Choice sample
Operation method
List box section (Choice)
"item1" to "item5" have been registered.
Select
Entering the item to be selected (such as "item2") in the input field on the right side and pressing the [Enter] key selects and displays "item2" in the list box.
Search/Result
Entering the item to be searched (such as "item5") in the input field on the right side and pressing the [Enter] key searches "item5" in the list box and displays index number "4" on the right side of the searched result. Only complete matching items are searched.
Index numbers to be displayed in the searched result starts from 0.
Remove
The selected item (such as "item2") is deleted.
Editable
Clicking the check box enables Choice to be edited. Entering the item (character string) in the edit field of Choice and pressing the [Enter] key adds the item. However, the item that has already been added or null character string cannot be added.
Auto sort
Clicking the check box sorts the items so that the selected item is positioned at the beginning of the list box.
Source codes
Choice sample:"Sample Storage Destinations"/jfchoice/JFChoiceSample.java