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
Swing is not thread safe. For more information see Swing's Threading Policy.
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 JavaBeans
has been added to the java.beans package.
Please see java..
| Modifier and Type | Class and Description |
|---|---|
| protected class | JPanel.
This class implements accessibility support for the
|
| Modifier and Type | Field and Description |
|---|---|
| private static final String |
| Access | Constructor and Description |
|---|---|
| public | JPanel(LayoutManager
the LayoutManager to use layout, boolean a boolean, true for double-buffering, which
uses additional memory space to achieve fast, flicker-free
updates isDoubleBuffered)Creates a new JPanel with the specified layout manager and buffering strategy. |
| public | JPanel(LayoutManager
the LayoutManager to use layout)Create a new buffered JPanel with the specified layout manager |
| public | JPanel(boolean
a boolean, true for double-buffering, which
uses additional memory space to achieve fast, flicker-free
updates isDoubleBuffered)Creates a new |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public AccessibleContext | Returns: an AccessibleJPanel that serves as the AccessibleContext of this JPanelOverrides java. Implements javax. Gets the AccessibleContext associated with this JPanel. |
| public PanelUI | Returns: the PanelUI object that renders this componentOverrides javax. Returns the look and feel (L&F) object that renders this component. |
| public String | Returns: the string "PanelUI"Overrides javax. Returns a string that specifies the name of the L&F class that renders this component. |
| protected String | Returns: a string representation of this JPanel.Overrides javax. Returns a string representation of this JPanel. |
| public void | |
| public void | updateUI()
Overrides javax. Resets the UI property with a value from the current look and feel. |
| private void | writeObject(ObjectOutputStream s)
Hides javax. See readObject() and writeObject() in JComponent for more information about serialization in Swing. |
| uiClassID | back to summary |
|---|---|
| private static final String uiClassID Hides javax.
| |
| JPanel | back to summary |
|---|---|
| public JPanel(LayoutManager layout, boolean isDoubleBuffered) Creates a new JPanel with the specified layout manager and buffering strategy.
| |
| JPanel | back to summary |
|---|---|
| public JPanel(LayoutManager layout) Create a new buffered JPanel with the specified layout manager
| |
| JPanel | back to summary |
|---|---|
| public JPanel(boolean isDoubleBuffered) Creates a new
| |
| JPanel | back to summary |
|---|---|
| public JPanel() Creates a new | |
| getAccessibleContext | back to summary |
|---|---|
| public AccessibleContext getAccessibleContext() Overrides java. Implements javax. 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.
| |
| getUI | back to summary |
|---|---|
| public PanelUI getUI() Overrides javax. Returns the look and feel (L&F) object that renders this component.
| |
| getUIClassID | back to summary |
|---|---|
| public String getUIClassID() Overrides javax. Returns a string that specifies the name of the L&F class that renders this component.
| |
| paramString | back to summary |
|---|---|
| protected String paramString() Overrides javax. 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
| |
| setUI | back to summary |
|---|---|
| public void setUI(PanelUI ui) Sets the look and feel (L&F) object that renders this component.
| |
| updateUI | back to summary |
|---|---|
| public void updateUI() Overrides javax. Resets the UI property with a value from the current look and feel.
| |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream s) throws IOException Hides javax. See readObject() and writeObject() in JComponent for more information about serialization in Swing.
| |
JPanel class. It provides an implementation of the
Java Accessibility API appropriate to panel user-interface
elements.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 JavaBeans
has been added to the java.beans package.
Please see java..
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public AccessibleRole | Returns: an instance of AccessibleRole describing the role of the objectOverrides javax. Get the role of this object. |
| AccessibleJPanel | back to summary |
|---|---|
| protected AccessibleJPanel() Constructs an | |
| getAccessibleRole | back to summary |
|---|---|
| public AccessibleRole getAccessibleRole() Overrides javax. Get the role of this object.
| |