Class ColorSelector

All Implemented Interfaces:
ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, SwingConstants

public class ColorSelector extends JButton
Represents a color selector.
Since:
August 16, 2010
Author:
noblemaster
See Also:
Serialized Form
  • Constructor Details

    • ColorSelector

      public ColorSelector()
      The constructor.
    • ColorSelector

      public ColorSelector(Color color, Color[][] colors)
      The constructor.
      Parameters:
      color - The active color.
      colors - The colors to select from.
  • Method Details

    • getColor

      public Color getColor()
      Returns the color.
      Returns:
      The color.
    • setColor

      public void setColor(Color color)
      Sets the color.
      Parameters:
      color - The color.
    • getColors

      public Color[][] getColors()
      Returns the colors.
      Returns:
      The colors.
    • setColors

      public void setColors(Color[][] colors)
      Sets the colors.
      Parameters:
      colors - The colors.
    • getDefaultColors

      public static Color[][] getDefaultColors()
      Returns the base colors.
      Returns:
      The base colors.
    • getPreferredSize

      public Dimension getPreferredSize()
      Returns the preferred size.
      Overrides:
      getPreferredSize in class JComponent
      Returns:
      The preferred size.
    • paint

      public void paint(Graphics g)
      Draws this component.
      Overrides:
      paint in class JComponent
      Parameters:
      g - Where to draw to.