Class ColorPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ColorPanel extends JPanel
Displays a colour.
See Also:
  • Constructor Details

    • ColorPanel

      public ColorPanel()
  • Method Details

    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • setBounds

      public void setBounds(int x, int y, int w, int h)
      Workaround for bug 4238829 in the Java bug database
      Overrides:
      setBounds in class Component
    • setFillColor

      public void setFillColor(Color fillColor)
    • setLineColor

      public void setLineColor(Color lineColor)
      Parameters:
      lineColor - the new line colour, or null to not draw the line
    • setMargin

      public void setMargin(int margin)
    • getFillColor

      public Color getFillColor()
    • getLineColor

      public Color getLineColor()
    • setLineWidth

      public void setLineWidth(int lineWidth)
    • getLineWidth

      public int getLineWidth()