javax.swing
Class JPanel

public class JPanel
extends javax.swing.JComponent
implements javax.accessibility.Accessible
JPanel is a generic lightweight container. For examples and task-oriented documentation for JPanel, see How to Use Panels, a section in The Java Tutorial.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder.

Version:
1.46 12/19/03
Author:
Arnaud Weber
Steve Wilson
Field Detail

uiClassID

private static final java.lang.String uiClassID
See Also:
#getUIClassID
#readObject

Constructor Detail

JPanel

public JPanel(java.awt.LayoutManager layout,
              boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy.
Parameters:
layout - the LayoutManager to use
isDoubleBuffered - a boolean, true for double-buffering, which uses additional memory space to achieve fast, flicker-free updates

JPanel

public JPanel(java.awt.LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
Parameters:
layout - the LayoutManager to use

JPanel

public JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy. If isDoubleBuffered is true, the JPanel will use a double buffer.
Parameters:
isDoubleBuffered - a boolean, true for double-buffering, which uses additional memory space to achieve fast, flicker-free updates

JPanel

public JPanel()
Creates a new JPanel with a double buffer and a flow layout.

Method Detail

updateUI

public void updateUI()
Resets the UI property with a value from the current look and feel.
See Also:
JComponent#updateUI

getUI

public javax.swing.plaf.PanelUI getUI()
Returns the look and feel (L&F) object that renders this component.
Returns:
the PanelUI object that renders this component
Since:
1.4

setUI

public void setUI(javax.swing.plaf.PanelUI ui)
Sets the look and feel (L&F) object that renders this component.
Parameters:
ui - the PanelUI L&F object
Since:
1.4
See Also:
UIDefaults#getUI

getUIClassID

public java.lang.String getUIClassID()
Returns a string that specifies the name of the L&F class that renders this component.
Returns:
"PanelUI"
See Also:
JComponent#getUIClassID
UIDefaults#getUI

writeObject

private void writeObject(java.io.ObjectOutputStream s)
See readObject() and writeObject() in JComponent for more information about serialization in Swing.

paramString

protected java.lang.String paramString()
Returns a string representation of this JPanel. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.
Returns:
a string representation of this JPanel.

getAccessibleContext

public javax.accessibility.AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel. For JPanels, the AccessibleContext takes the form of an AccessibleJPanel. A new AccessibleJPanel instance is created if necessary.
Returns:
an AccessibleJPanel that serves as the AccessibleContext of this JPanel