
281Built-In MATLAB
®
Widgets and Java Classes
selectedColor = jc.getSelectedColor;
selectedColorName = jc.getSelectedName;
The property inspector uses a different control to edit color properties of MATLAB HG
objects. As can be seen below, editing a gure handle’s Color property displays a modal com.
mathworks.mlwidgets.graphics.ColorDialo g window; when clicking its <More
Colors…> button, a new window containing a Swing JColorChooser is presented:
>> inspect(gcf)
MATLAB’s ColorDialog (See color insert.)
A ColorDialog can also be presented programmatically from within our GUI, regardless
of any property inspector. To present a ColorDialog