Class ColorSwatch

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ColorSwatch extends JPanel
This is a square, opaque panel used to indicate a certain color.

The color is assigned with the setForeground() method.

Also the user can right-click this panel and select 'Copy' to send a 100x100 image of this color to the clipboard. (This feature was added at the request of a friend who paints; she wanted to select a color and then quickly print it off, and then mix her paints to match that shade.)

See Also:
  • Constructor Details

    • ColorSwatch

      public ColorSwatch(int width)
    • ColorSwatch

      public ColorSwatch(Color color, int width)
  • Method Details