Class Panel
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Panel — AWT's generic on-screen container,
not JPanel. Peers over a plain Vaadin
<div> (inherited from Container), which is
what every built-in LayoutManager needs: the CSS
emitters refuse to write to a non-<div> host.
Panel form = new Panel(new BorderLayout(8, 4));
form.add(new Label("Name"), BorderLayout.NORTH);
form.add(field, BorderLayout.CENTER);
outer.add(form); // FlowLayout by default on `outer`
Everything a migrator calls on a Panel is inherited
Container: add and its four overloads,
remove / removeAll, setLayout / getLayout,
getComponent(int) / getComponents() /
getComponentCount(), getInsets, validate /
doLayout / invalidate, isAncestorOf, Z-order, and
ContainerListener — which this layer fires for real, unlike a
pure-surrogate container (SD_listeners_without_analog).
There is deliberately no SPanel surrogate: subtract
SJPanel's Swing half (border, opaque, client properties, L&F)
and nothing is left for one to hold — the child list belongs to Vaadin's
HasComponents, the layout manager to LayoutStore. Per
SD_no_spanel this is CLAUDE.md's group-2 shape (a structural shell on a bare
Vaadin element), the carve-out against D_surrogate_first's surrogate-first default.
Leaf peer is locked down per R_leaf_peer_lockdown. java.applet.Applet is
java.awt.Panel's only JDK subclass, and applets are permanently
out of scope (R_match_swing_errors sub-bucket (b)) — the JDK classes are removed in Java 26
per JEP 504, so unlike javax.swing.plaf this subclass cannot come
back as future non-leaf pressure. Both ctors funnel through
super(), so every instance — including a user-code subclass —
peers over a Div and no ctor offers a peer seam.
A layout installed after the Panel is on screen does not take
effect until validate() / revalidate(), matching
AWT — setLayout only invalidates. The outgoing manager's
CSS *is* dropped at setLayout, so the un-revalidated
interval renders as plain block flow rather than the old
layout's; see Container#setLayout.
- See Also:
-
Field Summary
Fields inherited from class Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, FILL_CHROME, FILL_DEFAULT, LEFT_ALIGNMENT, listenerList, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionPanel()JDK chains this tothis(new FlowLayout())— centered, 5px gaps.Panel(LayoutManager layout) -
Method Summary
Methods inherited from class Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, addSlotChild, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, fireHierarchyEvent, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, isValidateRoot, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, peerContentElement, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, removeSlotChild, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, update, validate, validateTreeMethods inherited from class Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, applyBackgroundToPeer, applyVisibleToPeer, awtListeners, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, defaultFillCssClass, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, fireComponentEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isThemeDefault, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, peerIs, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, suppressMouseBridge, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, withPeer, withPeerOnLiveUI
-
Constructor Details
-
Panel
public Panel()JDK chains this tothis(new FlowLayout())— centered, 5px gaps. -
Panel
- Parameters:
layout- null is legal and installs no manager, exactly as in AWT — children then render in the peer<div>'s default block flow andgetLayout()returns null. Do not substitute aFlowLayouthere.
-
-
Method Details
-
addNotify
-
getAccessibleContext
- Specified by:
getAccessibleContextin interfaceAccessible- Overrides:
getAccessibleContextin classComponent- Returns:
- always null — accessibility contexts are permanently out of
scope (R_match_swing_errors sub-bucket (b)), as on
Button/Label/JPanel
-