public class JColor extends Object implements Serializable
This class was created because the Color class has no method to change its existing Color composition, making it difficult to change a color without creating another Color object.
Therefore, programs should make a refernece to a JColor object instead of a Color object, allowing changing of the encapsulated Color object without changing the reference to the JColor object.
| Constructor and Description |
|---|
JColor(Color color)
Creates a JColor object that encapsulates a Color object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addActionListener(ActionListener listener)
Registers a listener to be notified of changes to the Color object
encapsulated by JColor.
|
Color |
getColor()
Returns the Color encapsulated by JColor.
|
void |
removeActionListener(ActionListener listener)
Unregisters a listener of changes in Color object encapsulated by JColor.
|
void |
setColor(Color color)
Changes the Color object encapsulated by JColor
|
public JColor(Color color)
color - The Color object to be encapsulated.public Color getColor()
public void setColor(Color color)
color - New Color object to be encapsulated.public void addActionListener(ActionListener listener)
listener - ActionListener object to be notified.public void removeActionListener(ActionListener listener)
Copyright © 2019 JULIE Lab, Germany. All rights reserved.