APIdia Launch Partner
Top Description Methods
javax.swing.colorchooser

public Interface ColorSelectionModel

Known Direct Implementers
javax.swing.colorchooser.DefaultColorSelectionModel
Imports
javax.swing.*, javax.swing.event.*, java.awt.Color

A model that supports selecting a Color.
Author
Steve Wilson
See Also
java.awt.Color

Method Summary

Modifier and TypeMethod and Description
public void
addChangeListener(ChangeListener
the ChangeListener to be added
listener
)

Adds listener as a listener to changes in the model.

public Color

Returns:

the selected Color
getSelectedColor
()

Returns the selected Color which should be non-null.

public void
removeChangeListener(ChangeListener
the ChangeListener to be removed
listener
)

Removes listener as a listener to changes in the model.

public void
setSelectedColor(Color
the new Color
color
)

Sets the selected color to color.

Method Detail

addChangeListenerback to summary
public void addChangeListener(ChangeListener listener)

Adds listener as a listener to changes in the model.

Parameters
listener:ChangeListener

the ChangeListener to be added

getSelectedColorback to summary
public Color getSelectedColor()

Returns the selected Color which should be non-null.

Returns:Color

the selected Color

See Also
setSelectedColor
removeChangeListenerback to summary
public void removeChangeListener(ChangeListener listener)

Removes listener as a listener to changes in the model.

Parameters
listener:ChangeListener

the ChangeListener to be removed

setSelectedColorback to summary
public void setSelectedColor(Color color)

Sets the selected color to color. Note that setting the color to null is undefined and may have unpredictable results. This method fires a state changed event if it sets the current color to a new non-null color.

Parameters
color:Color

the new Color

See Also
getSelectedColor, addChangeListener