javax.swing.colorchooser

Interface ColorSelectionModel

public interface ColorSelectionModel

A model that is used by the {@link JColorChooser} component to represent the selected color.
Method Summary
voidaddChangeListener(ChangeListener listener)
Registers a listener to receive {@link ChangeEvent} notifications from this model.
ColorgetSelectedColor()
Returns the selected color.
voidremoveChangeListener(ChangeListener listener)
Deregisters a listener so that it no longer receives {@link ChangeEvent} notifications from this action.
voidsetSelectedColor(Color color)
Sets the selected color.

Method Detail

addChangeListener

public void addChangeListener(ChangeListener listener)
Registers a listener to receive {@link ChangeEvent} notifications from this model.

Parameters: listener the listener.

getSelectedColor

public Color getSelectedColor()
Returns the selected color.

Returns: The selected color.

removeChangeListener

public void removeChangeListener(ChangeListener listener)
Deregisters a listener so that it no longer receives {@link ChangeEvent} notifications from this action.

Parameters: listener the listener.

setSelectedColor

public void setSelectedColor(Color color)
Sets the selected color.

Parameters: color the selected color.