All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.JPanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.JPanel

public class JPanel
extends JComponent
A lightweight panel that provides double buffering support.


Variable Index

 o darkGray
 o ETCHED
 o gray
 o lightGray
 o LOWERED
 o NONE
 o RAISED

Constructor Index

 o JPanel()
Creates a Lightweight Panel
 o JPanel(boolean)
Creates a Lightweight Panel.
 o JPanel(LayoutManager)
Creates a new panel with the specified layout manager.

Method Index

 o createOffscreenImage()
 o getBorderStyle()
Returns the style of the border.
 o invalidate()
Invalidates the panel.
 o isBuffered()
Returns whether this panel is double buffered.
 o isOpaque()
 o paint(Graphics)
Paints the panel
 o paintBorder(Graphics)
 o setBackgroundCleared(boolean)
Sets whether the paint method fills the background before painting.
 o setBorderStyle(int)
Set the style of the border.
 o setBounds(int, int, int, int)
Override setBounds to null out the offscreen buffer.
 o setBuffered(boolean)
If b is "true", then all painting is double buffered.
 o validate()
Validates the panel.

Variables

 o NONE
 public static final int NONE
 o LOWERED
 public static final int LOWERED
 o RAISED
 public static final int RAISED
 o ETCHED
 public static final int ETCHED
 o darkGray
 public static final Color darkGray
 o gray
 public static final Color gray
 o lightGray
 public static final Color lightGray

Constructors

 o JPanel
 public JPanel()
Creates a Lightweight Panel

 o JPanel
 public JPanel(LayoutManager layout)
Creates a new panel with the specified layout manager.

Parameters:
layout - the layout manager for this panel
 o JPanel
 public JPanel(boolean buffered)
Creates a Lightweight Panel. If buffered is "true", then all painting will be double buffered.

Methods

 o isBuffered
 public boolean isBuffered()
Returns whether this panel is double buffered.

 o setBuffered
 public void setBuffered(boolean b)
If b is "true", then all painting is double buffered.

 o getBorderStyle
 public int getBorderStyle()
Returns the style of the border.

 o setBorderStyle
 public void setBorderStyle(int borderStyle)
Set the style of the border.

 o validate
 public void validate()
Validates the panel. If the panel needs double buffering, it probes upwards to determine if a parent is already double buffering. If one is found, then this panel will not do the buffering.

Overrides:
validate in class Container
 o createOffscreenImage
 protected void createOffscreenImage()
 o invalidate
 public void invalidate()
Invalidates the panel.

Overrides:
invalidate in class Container
 o setBounds
 public void setBounds(int x,
                       int y,
                       int w,
                       int h)
Override setBounds to null out the offscreen buffer.

Overrides:
setBounds in class JComponent
 o isOpaque
 public boolean isOpaque()
Overrides:
isOpaque in class JComponent
 o setBackgroundCleared
 public void setBackgroundCleared(boolean b)
Sets whether the paint method fills the background before painting.

 o paint
 public void paint(Graphics g)
Paints the panel

Overrides:
paint in class JComponent
 o paintBorder
 public void paintBorder(Graphics g)

All Packages  Class Hierarchy  This Package  Previous  Next  Index