
403Customizing MATLAB
®
Controls
To overcome this, set the labels via the model, not the HG String property:
†
jListbox.getModel.setElementAt('Undocumented Matlab',index-1);
The ListData property is settable-only, and so cannot be used to get the list of all existing
items. Instead, use
jListbox.getModel.toArray.cell to get the list as a MATLAB cell array.
This list can also be gotten as an enumerated list by using
jListbox.getModel.elements. See
Section 2.1.3 for enumeration usage details.
As another example of customizing listbox items, consider the request I once received to set
a dedicated behavior (e.g., display a dedicated text) for selected ...