
Undocumented Secrets of MATLAB
®
-Java Programming296
AutoCompletionList also creates a component in a similar way. This component has a
list of string items where the user can type in the header row and the cursor automatically
selects the corresponding list item and autocompletes the rest of the entry. Invalid user entries
are greeted with a beep and are not allowed by default (unless setStrict(false) is called). Items
can be selected either by entering text in the header row, or by selecting a list item:
strs = {'This','is','test1','test2'};
strList = java.util.ArrayList;
for idx = 1 : length(strs), strList.add(strs{idx}); end
jPanelObj ...