Class PaintPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class PaintPanel extends JPanel
A panel which support Paint as background.
See Also:
  • Field Details

    • _startColor

      protected Color _startColor
    • _endColor

      protected Color _endColor
    • _isVertical

      protected boolean _isVertical
  • Constructor Details

    • PaintPanel

      public PaintPanel()
    • PaintPanel

      public PaintPanel(boolean isDoubleBuffered)
    • PaintPanel

      public PaintPanel(LayoutManager layout)
    • PaintPanel

      public PaintPanel(LayoutManager layout, boolean isDoubleBuffered)
  • Method Details

    • getBackgroundPaint

      public Paint getBackgroundPaint()
      Gets the Paint that will be used to paint background.
      Returns:
      the background paint.
    • setBackgroundPaint

      public void setBackgroundPaint(Paint backgroundPaint)
      Sets the Paint that will be used to paint background.
      Parameters:
      backgroundPaint -
    • createTexturePaint

      public static TexturePaint createTexturePaint(JPanel panel, Image img, int x, int y, int w, int h)
    • setGradientPaint

      public void setGradientPaint(Color startColor, Color endColor, boolean isVertical)
      This method allows you to use gradient background without using setBackgroundPaint(java.awt.Paint) method. You can use GradientPaint to do the same thing. However if you use this method, it will use fast gradient paint defined in JideSwingUtilities to do the painting.
      Parameters:
      startColor - start color of the gradient
      endColor - end color of the gradient
      isVertical - vertical or not
    • getStartColor

      public Color getStartColor()
    • setStartColor

      public void setStartColor(Color startColor)
    • getEndColor

      public Color getEndColor()
    • setEndColor

      public void setEndColor(Color endColor)
    • isVertical

      public boolean isVertical()
    • setVertical

      public void setVertical(boolean vertical)
    • paintComponent

      protected void paintComponent(Graphics g)
      Paints the background.
      Overrides:
      paintComponent in class JComponent
      Parameters:
      g -