Class ColorLabel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class ColorLabel extends JComponent
See Also:
  • Constructor Details

    • ColorLabel

      public ColorLabel(IColorChangeListener listener, Color color, Font font, String prompt)
      Create an inert color label.
      Parameters:
      color - the color.
      prompt - the prompt string.
  • Method Details

    • setColorListener

      public void setColorListener(IColorChangeListener listener)
      Set the color change listener
      Parameters:
      listener - the color change listener
    • paintComponent

      public void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent
    • getColor

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

      public void setColor(Color newColor)
      Set the new color.
      Parameters:
      newColor - the new color index.