javax.swing

Class JPanel

public class JPanel extends JComponent implements Accessible

An instance of JPanel can be added to a panel, frame etc
Nested Class Summary
protected classJPanel.AccessibleJPanel
Provides accessibility support for JPanel.
Constructor Summary
JPanel()
Creates a new panel with a new instance of {@link FlowLayout} as the layout manager and double-buffering enabled.
JPanel(boolean isDoubleBuffered)
Creates a new panel with double-buffering enabled or disabled as specified.
JPanel(LayoutManager layout)
Creates a new panel with the specified layout manager.
JPanel(LayoutManager layout, boolean isDoubleBuffered)
Creates a new panel with the specified layout manager and double-buffering.
Method Summary
AccessibleContextgetAccessibleContext()
Returns the object that provides accessibility features for this JPanel component.
PanelUIgetUI()
Returns the UI delegate for the JPanel component.
StringgetUIClassID()
Returns the suffix ("PanelUI" in this case) used to determine the class name for a UI delegate that can provide the look and feel for a JPanel.
protected StringparamString()
Returns an implementation-dependent string describing the attributes of this JPanel.
voidsetUI(PanelUI ui)
Sets the UI delegate for the JPanel component.
voidupdateUI()
Sets this panel's UI delegate to the default (obtained from the {@link UIManager}) for the current look and feel.

Constructor Detail

JPanel

public JPanel()
Creates a new panel with a new instance of {@link FlowLayout} as the layout manager and double-buffering enabled.

JPanel

public JPanel(boolean isDoubleBuffered)
Creates a new panel with double-buffering enabled or disabled as specified. The default layout manager is an instance of {@link FlowLayout}.

Parameters: isDoubleBuffered a flag that controls whether or not double-buffering is enabled.

JPanel

public JPanel(LayoutManager layout)
Creates a new panel with the specified layout manager. Double-buffering is enabled by default.

Parameters: layout the layout manager (null permitted).

JPanel

public JPanel(LayoutManager layout, boolean isDoubleBuffered)
Creates a new panel with the specified layout manager and double-buffering.

Parameters: layout the layout manager (null permitted). isDoubleBuffered a flag that controls whether or not double-buffering is enabled.

Method Detail

getAccessibleContext

public AccessibleContext getAccessibleContext()
Returns the object that provides accessibility features for this JPanel component.

Returns: The accessible context (an instance of {@link AccessibleJPanel}).

getUI

public PanelUI getUI()
Returns the UI delegate for the JPanel component.

Returns: The UI delegate.

Since: 1.4

See Also: setUI

getUIClassID

public String getUIClassID()
Returns the suffix ("PanelUI" in this case) used to determine the class name for a UI delegate that can provide the look and feel for a JPanel.

Returns: "PanelUI".

paramString

protected String paramString()
Returns an implementation-dependent string describing the attributes of this JPanel.

Returns: A string describing the attributes of this JPanel (never null).

setUI

public void setUI(PanelUI ui)
Sets the UI delegate for the JPanel component.

Parameters: ui the UI delegate.

Since: 1.4

See Also: getUI

updateUI

public void updateUI()
Sets this panel's UI delegate to the default (obtained from the {@link UIManager}) for the current look and feel.