javax.swing
public class: JPanel [javadoc |
source]
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
All Implemented Interfaces:
Accessible, HasGetTransferHandler, Serializable, MenuContainer, ImageObserver
Direct Known Subclasses:
SidePane, JPanelNeuerKunde, VCirPanel, SwatchPanel, XPanel, ScrollLabel, DefaultEditor, JPanelEtatEinsehen, DefaultPreviewPanel, CMapDisplay, JChecklistInfo, SidePaneHeader, VEllPanel, JTextFields, DefaultSwatchChooserPanel, BeanEditPanel, TaskBar, VShapePanel, ScrollableTabPanel, JPanelKundenUebersicht, SETIPanel, ListTablePanel, GlyphPanel, JPanelNeuerLieferant, MainSwatchPanel, FieldPanel, AbstractColorChooserPanel, SwatchChooserPanel, PhoneMachinePanel, BoxToolbar, RecentSwatchPanel, TabContainer, ListEditor, VDiamPanel, JPanelArbeitsplatzlager, PlaylistEditor, VTrgPanel, DollarsPanel, Beale, JPanelKundeBearbeiten, SwatchPanel, KDollarsPanel, EditableFigureComponent, SidePaneComponent, TablePanel, GroupSelector, MainSwatchPanel, JPanelZahlungseingang, DisplayFigureComponent, JPanelLieferantBearbeiten, JPanelHilfe, DefaultRGBChooserPanel, JAIFilePreviewer, CroppedEdge, VOctPanel, ThreadManagerPanel, AbstractOverviewPanel, DisplayPanel, RecentSwatchPanel, PrefsPane, JPanelLieferantenliste, JPanelVertragEinsehen, JPanelNeuerVertrag, DefaultHSBChooserPanel, NumberEditor, Dict, SpoolViewerPanel, VRectPanel, GPSInfoPanel, JPanelSimulationStart, CWlanLayer, MsgWriter, DateEditor, DetailPanel, CMapLayer, ColorIndicator, JPanelOptions, EncodingChooser, DictDockable, MsgViewer
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 JavaBeansTM
has been added to the java.beans package.
Please see java.beans.XMLEncoder .
- beaninfo:
description - : A generic lightweight container.
- author:
Arnaud - Weber
- author:
Steve - Wilson
| Nested Class Summary: |
|---|
| protected class | JPanel.AccessibleJPanel | This class implements accessibility support for the
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 JavaBeansTM
has been added to the java.beans package.
Please see {@link java.beans.XMLEncoder}. |
| Fields inherited from javax.swing.JComponent: |
|---|
| DEBUG_GRAPHICS_LOADED, ui, listenerList, paintingChild, WHEN_FOCUSED, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_WINDOW, UNDEFINED_CONDITION, TOOL_TIP_TEXT_KEY, focusController, accessibleContext |
| Fields inherited from java.awt.Container: |
|---|
| ncomponents, component, layoutMgr, containerListener, listeningChildren, listeningBoundsChildren, descendantsCount, INCLUDE_SELF, SEARCH_HEAVYWEIGHTS, modalComp, modalAppContext |
| Fields inherited from java.awt.Component: |
|---|
| TOP_ALIGNMENT, CENTER_ALIGNMENT, BOTTOM_ALIGNMENT, RIGHT_ALIGNMENT, LEFT_ALIGNMENT, treeLock, x, y, width, height, foreground, background, font, peerFont, cursor, locale, ignoreRepaint, visible, enabled, valid, dropTarget, popups, name, nameExplicitlySet, focusable, isFocusTraversableOverridden, focusTraversalKeys, focusTraversalKeysEnabled, minSize, prefSize, newEventsOnly, eventMask, changeSupport, isPacked, componentSerializedDataVersion, accessibleContext, componentListener, focusListener, keyListener, mouseListener, mouseMotionListener, mouseWheelListener, inputMethodListener, hierarchyListener, hierarchyBoundsListener, parent, peer, orientation, graphicsConfig, bufferStrategy |
| Constructor: |
public JPanel() {
this(true);
}
Creates a new JPanel with a double buffer
and a flow layout. |
public JPanel(LayoutManager layout) {
this(layout, true);
}
Create a new buffered JPanel with the specified layout manager Parameters:
layout - the LayoutManager to use
|
public JPanel(boolean isDoubleBuffered) {
this(new FlowLayout(), 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
|
public JPanel(LayoutManager layout,
boolean isDoubleBuffered) {
setLayout(layout);
setDoubleBuffered(isDoubleBuffered);
setUIProperty("opaque", Boolean.TRUE);
updateUI();
}
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
|
| Methods from javax.swing.JComponent: |
|---|
|
_paintImmediately, addAncestorListener, addNotify, addVetoableChangeListener, alwaysOnTop, checkIfChildObscuredBySibling, clientPropertyChanged, compWriteObjectNotify, componentInputMapChanged, computeVisibleRect, computeVisibleRect, contains, createToolTip, disable, dndDone, dropLocationForPoint, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getCreatedDoubleBuffer, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getGraphicsInvoked, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getManagingFocusBackwardTraversalKeys, getManagingFocusForwardTraversalKeys, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getWriteObjCounter, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPainting, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintForceDoubleBuffered, paintImmediately, paintImmediately, paintToOffscreen, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyBindings, processKeyBindingsForAllComponents, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, rectangleIsObscured, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, safelyGetGraphics, safelyGetGraphics, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setCreatedDoubleBuffer, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setDropLocation, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPaintingChild, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setUIProperty, setVerifyInputWhenFocusTarget, setVisible, setWriteObjCounter, shouldDebugGraphics, superProcessMouseMotionEvent, unregisterKeyboardAction, update, updateUI |
| Methods from java.awt.Container: |
|---|
|
add, add, add, add, add, addContainerListener, addImpl, addNotify, addPropertyChangeListener, addPropertyChangeListener, adjustDecendantsOnParent, adjustDescendants, adjustListeningChildren, applyComponentOrientation, areFocusTraversalKeysSet, canContainFocusOwner, checkGD, clearCurrentFocusCycleRootOnHide, clearMostRecentFocusOwnerOnHide, containsFocus, countComponents, countHierarchyMembers, createChildHierarchyEvents, createHierarchyEvents, decreaseComponentCount, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, findComponentAt, findComponentAtImpl, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponentZOrder, getComponents, getComponents_NoClientCode, getContainerListeners, getDropTargetEventTarget, getFocusTraversalKeys, getFocusTraversalPolicy, getHeavyweightContainer, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMouseEventTarget, getMousePosition, getPreferredSize, getTraversalRoot, increaseComponentCount, initializeFocusTraversalKeys, insets, invalidate, invalidateTree, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, isSameOrAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, mixOnHiding, mixOnReshaping, mixOnShowing, mixOnZOrderChanging, numListening, paint, paintComponents, paintHeavyweightComponents, paramString, postProcessKeyEvent, postsOldMouseEvents, preProcessKeyEvent, preferredSize, print, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, recursiveApplyCurrentShape, recursiveApplyCurrentShape, recursiveApplyCurrentShape, recursiveSubtractAndApplyShape, recursiveSubtractAndApplyShape, recursiveSubtractAndApplyShape, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate, validateTree |
| Methods from java.awt.Component: |
|---|
|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, dispatchEventImpl, doLayout, enable, enable, enableEvents, enableInputMethods, eventTypeEnabled, findNextFocusComponent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, generateName, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getGraphicsConfigurationImpl, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFocusable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFocusable, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setPeer, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, translateEvent, update, validate |
| Methods from java.lang.Object: |
|---|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from javax.swing.JPanel Detail: |
public AccessibleContext getAccessibleContext() {
if (accessibleContext == null) {
accessibleContext = new AccessibleJPanel();
}
return accessibleContext;
}
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. |
public PanelUI getUI() {
return (PanelUI)ui;
}
Returns the look and feel (L&F) object that renders this component. |
public String getUIClassID() {
return uiClassID;
}
Returns a string that specifies the name of the L&F class
that renders this component. |
protected String paramString() {
return super.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. |
public void setUI(PanelUI ui) {
super.setUI(ui);
}
Sets the look and feel (L&F) object that renders this component. |
public void updateUI() {
setUI((PanelUI)UIManager.getUI(this));
}
Resets the UI property with a value from the current look and feel. |