ColorButton Class
This is a class that extends JButton class. The ColorButton object can be added to a JFrame. Create ColorButton class with the following properties:
-
Instance variables: Declare three instance variables:
- A String object for the button label
- A Color object for the pen color
- A Dimension object for the size of the button
-
Constructor: Take in four arguments:
- The String label that will go on this button
- The Color this button will change the pen's "ink" color to.
- An int for the width of the button
- An int for the height of the button
- Accessor method: return the label of the button.
- Accessor method: return the color of "ink" that this button has.
- Accessor method: return the size of this button.