Class ColorButton

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

public class ColorButton extends JButton
A button that displays a color and allows the user to change it.
See Also:
  • Constructor Details

    • ColorButton

      public ColorButton(String label, Color initial)
      Creates a color button using the original default behavior.
      Parameters:
      label - button label
      initial - initial color
    • ColorButton

      public ColorButton(String label, String dialogTitle, Color initial, boolean allowNoColor, boolean allowTransparency)
      Creates a configurable color button.
      Parameters:
      label - button label
      dialogTitle - color-dialog title
      initial - initial color
      allowNoColor - whether null/no color is permitted
      allowTransparency - whether alpha may be selected
  • Method Details

    • getColor

      public Color getColor()
    • setColor

      public void setColor(Color color)