Additional top-level class in compilation unit: LightweightDispatcher.
Components added to a container are tracked in a list. The order of the list will define the components' front-to-back stacking order within the container. If no index is specified when adding a component to a container, it will be added to the end of the list (and hence to the bottom of the stacking order).
Note
For details on the focus subsystem, see How to Use the Focus Subsystem, a section in The Java Tutorial, and the Focus Specification for more information.
add(java.awt.Component, int) , getComponent(int), LayoutManager
| Modifier and Type | Class and Description |
|---|---|
| protected class | Container.
Inner class of Container used to provide default support for accessibility. |
| pack-priv static class | |
| pack-priv static interface | |
| pack-priv static class | |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private List | component
The components in this container. |
| pack-priv transient ContainerListener | |
| private int | containerSerializedDataVersion
Container Serial Data Version. |
| pack-priv transient int | |
| private static boolean | descendUnconditionallyWhenValidating
Indicates whether valid containers should also traverse their children and call the validateTree() method on them. |
| private LightweightDispatcher | dispatcher
Event router for lightweight components. |
| private static final Component[] | |
| private static final PlatformLogger | |
| private boolean | focusCycleRoot
Indicates whether this Component is the root of a focus traversal cycle. |
| private transient FocusTraversalPolicy | focusTraversalPolicy
The focus traversal policy that will manage keyboard traversal of this Container's children, if this Container is a focus cycle root. |
| private boolean | focusTraversalPolicyProvider
Stores the value of focusTraversalPolicyProvider property. |
| pack-priv static final boolean | INCLUDE_SELF
A constant which toggles one of the controllable behaviors
of |
| private static final boolean | |
| pack-priv LayoutManager | layoutMgr
Layout manager for this container. |
| pack-priv transient int | |
| pack-priv transient int | |
| private static final PlatformLogger | log
Hides java. |
| private static final PlatformLogger | |
| pack-priv transient Component | |
| private transient int | |
| private transient int | |
| pack-priv transient Color | |
| private transient boolean | |
| private transient Set | |
| pack-priv static final boolean | SEARCH_HEAVYWEIGHTS
A constant which toggles one of the controllable behaviors
of |
| private static final ObjectStreamField[] | |
| private static final long | serialVersionUID
Use serialVersionUID from JDK 1.1 for interoperability.
|
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Component | |
| public Component | |
| public Component | |
| public void | |
| public void | add(Component
the component to be added comp, Object an object expressing layout constraints for this constraints, int the position in the container's list at which to insert
the component; index)-1 means insert at the end
componentAdds the specified component to this container with the specified constraints at the specified index. |
| public synchronized void | addContainerListener(ContainerListener
the container listener l)Adds the specified container listener to receive container events from this container. |
| private void | |
| protected void | addImpl(Component
the component to be added comp, Object an object expressing layout constraints
for this component constraints, int the position in the container's list at which to
insert the component, where index)-1
means append to the endAdds the specified component to this container at the specified index. |
| public void | addNotify()
Overrides java. Makes this Container displayable by connecting it to a native screen resource. |
| public void | addPropertyChangeListener(PropertyChangeListener
the PropertyChangeListener to be added listener)Overrides java. Adds a PropertyChangeListener to the listener list. |
| public void | addPropertyChangeListener(String
one of the property names listed above propertyName, PropertyChangeListener the PropertyChangeListener to be added listener)Overrides java. Adds a PropertyChangeListener to the listener list for a specific property. |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| public void | applyComponentOrientation(ComponentOrientation
the new component orientation of this container and
the components contained within it. o)Overrides java. Sets the |
| public boolean | Returns: true if the Set of focus traversal keys for the
given focus traversal operation has been explicitly defined for
this Component; false otherwise.one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or
KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS id)Overrides java. Returns whether the Set of focus traversal keys for the given focus traversal operation has been explicitly defined for this Container. |
| pack-priv boolean | canContainFocusOwner(Component focusOwnerCandidate)
Checks whether this container can contain component which is focus owner. |
| private void | checkAdding(Component comp, int index)
Checks that the component comp can be added to this container Checks : index in bounds of container's size, comp is not one of this container's parents, and comp is not a window. |
| private void | |
| pack-priv void | checkGD(String stringID)
Overrides java. Checks that all Components that this Container contains are on the same GraphicsDevice as this Container. |
| private void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv final boolean | |
| public int | Returns: the number of components in this container
Deprecated
As of JDK version 1.1,
replaced by getComponentCount().
Returns the number of components in this container. |
| pack-priv int | |
| pack-priv final void | |
| pack-priv final int | createHierarchyEvents(int id, Component changed, Container changedParent, long changeFlags, boolean enabledOnToolkit)
Overrides java.
|
| pack-priv final void | |
| public void | deliverEvent(Event e)
Overrides java.
Deprecated
As of JDK version 1.1,
replaced by
dispatchEvent(AWTEvent e)
|
| pack-priv void | |
| pack-priv void | |
| public void | |
| pack-priv boolean | |
| public Component | Returns: null if the component does not contain the position. If there is no child component at the requested point and the point is within the bounds of the container the container itself is returned.the x coordinate x, int the y coordinate y)Locates the visible child component that contains the specified position. |
| pack-priv final Component | findComponentAt(int x, int y, boolean ignoreEnabled)
Private version of findComponentAt which has a controllable behavior. |
| public Component | Returns: null if the component does not contain the position. If there is no child component at the requested point and the point is within the bounds of the container the container itself is returned.the point. p)Locates the visible child component that contains the specified point. |
| pack-priv final Component | |
| private Container | |
| pack-priv Accessible | Returns: theAccessible at the specified location,
if it exists; otherwise nullthe point defining the top-left corner of the
p)Accessible, given in the coordinate space
of the object's parentReturns the |
| pack-priv Accessible | Returns: the nthAccessible child of the objectzero-based index of child i)Returns the nth |
| pack-priv int | Returns: the number of accessible children in the objectReturns the number of accessible children in the object. |
| public float | |
| public float | |
| private int | |
| private static Component | getChildAt(Component comp, int x, int y, boolean ignoreEnabled)
Helper method for findComponentAtImpl. |
| public Component | Returns: the nth component in this container.the index of the component to get. n)Gets the nth component in this container. |
| public Component | Returns: null if the component does not contain the position. If there is no child component at the requested point and the point is within the bounds of the container the container itself is returned; otherwise the top-most child is returned.the x coordinate x, int the y coordinate y)Overrides java. Locates the component that contains the x,y position. |
| public Component | Returns: returns the component that contains the point, ornull if the component does
not contain the point.the point. p)Overrides java. Gets the component that contains the specified point. |
| public int | Returns: the number of components in this panel.Gets the number of components in this panel. |
| public Component[] | Returns: an array of all the components in this container.Gets all the components in this container. |
| pack-priv final Component[] | |
| pack-priv Component[] | |
| public int | Returns: the z-order index of the component; otherwise returns -1 if the component isnull
or doesn't belong to the containerthe component being queried comp)Returns the z-order index of the component inside the container. |
| public synchronized ContainerListener[] | Returns: all of this container'sContainerListeners
or an empty array if no container
listeners are currently registeredReturns an array of all the container listeners registered on this container. |
| pack-priv Component | getDropTargetEventTarget(int x, int y, boolean includeSelf)
Fetches the top-most (deepest) component to receive SunDropTargetEvents. |
| public Set | Returns: the Set of AWTKeyStrokes for the specified operation. The Set will be unmodifiable, and may be empty. null will never be returned.one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or
KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS id)Overrides java. Returns the Set of focus traversal keys for a given traversal operation for this Container. |
| public FocusTraversalPolicy | Returns: this Container's focus traversal policy, or null if this Container is not a focus cycle root.Returns the focus traversal policy that will manage keyboard traversal of this Container's children, or null if this Container is not a focus cycle root. |
| pack-priv Container | |
| public Insets | Returns: the insets of this container.Determines the insets of this container, which indicate the size of the container's border. |
| public LayoutManager | Returns: the current layout manager for this containerGets the layout manager for this container. |
| public <T extends EventListener> T[] | Returns: an array of all objects registered asFooListeners on this container,
or an empty array if no such listeners have been addedthe type of listeners requested; this parameter
should specify an interface that descends from
listenerType)java.util.EventListenerOverrides java. Returns an array of all the objects currently registered
as |
| private int | |
| public Dimension | Returns: an instance ofDimension that represents
the maximum size of this container.Overrides java. Returns the maximum size of this container. |
| public Dimension | Returns: an instance ofDimension that represents
the minimum size of this container.Overrides java. Returns the minimum size of this container. |
| pack-priv Component | getMouseEventTarget(int x, int y, boolean includeSelf)
Fetches the top-most (deepest) lightweight component that is interested in receiving mouse events. |
| private Component | getMouseEventTarget(int x, int y, boolean includeSelf, Container.
EventTargetFilter instance to determine whether the
given component is a valid target for this event. filter,if searchHeavyweights)false, the method
will bypass heavyweight components during the search.A private version of getMouseEventTarget which has two additional controllable behaviors. |
| private Component | getMouseEventTargetImpl(int x, int y, boolean includeSelf, Container.
EventTargetFilter instance to determine whether the
selected component is a valid target for this event. filter,if searchHeavyweightChildren, boolean true, the method
will bypass immediate lightweight children during the search.
If false, the methods will bypass immediate
heavyweight children during the search.if searchHeavyweightDescendants)false, the method
will bypass heavyweight descendants which are not immediate
children during the search. If true, the method
will traverse both lightweight and heavyweight descendants during
the search.A private version of getMouseEventTarget which has three additional controllable behaviors. |
| public Point | Returns: mouse coordinates relative to thisComponent, or nulltrue if children should be taken into account allowChildren)Returns the position of the mouse pointer in this |
| pack-priv final Region | getOpaqueShape()
Overrides java. Returns the "opaque shape" of the component. |
| public Dimension | Returns: an instance ofDimension that represents
the preferred size of this container.Overrides java. Returns the preferred size of this container. |
| private int | |
| pack-priv final Container | |
| pack-priv final boolean | Returns: true if there is at least one heavyweight children in a container, false otherwiseChecks whether or not this container has heavyweight children. |
| pack-priv final boolean | Returns: true if there is at least one lightweight children in a container, false otherwiseChecks whether or not this container has lightweight children. |
| pack-priv final void | |
| pack-priv void | |
| private static native void | initIDs()
Hides java. Initialize JNI field and method IDs for fields that may be called from C. |
| public Insets | Returns: the insets for this container
Deprecated
As of JDK version 1.1,
replaced by
getInsets().
Returns the insets for this container. |
| public void | |
| pack-priv void | invalidateParent()
Overrides java. Invalidates the parent of the container unless the container is a validate root. |
| pack-priv void | |
| public boolean | Returns: true if it is an ancestor;
false otherwise.the component c)Checks if the component is contained in the component hierarchy of this container. |
| public boolean | Returns: true if the specified Container is a focus-cycle-
root of this Container; false otherwisethe Container to be tested container)Overrides java. Returns whether the specified Container is the focus cycle root of this Container's focus traversal cycle. |
| public boolean | Returns: whether this Container is the root of a focus traversal cycleReturns whether this Container is the root of a focus traversal cycle. |
| public final boolean | Returns: true if this container provides focus traversal
policy, false otherwiseReturns whether this container provides focus traversal policy. |
| public boolean | Returns: true if the focus traversal policy has been
explicitly set for this Container; false otherwise.Returns whether the focus traversal policy has been explicitly set for this Container. |
| private boolean | isParentOf(Component
a component in test, must not be null comp)Check if this component is the child of this container or its children. |
| pack-priv final boolean | isRecursivelyVisibleUpToHeavyweightContainer()
Checks if the container and its direct lightweight containers are visible. |
| private static boolean | isRemoveNotifyNeeded(Component comp, Container oldContainer, Container newContainer)
Detects whether or not remove from current parent and adding to new parent requires call of removeNotify on the component. |
| pack-priv boolean | isSameOrAncestorOf(Component comp, boolean allowChildren)
Overrides java. Overridden in Container. |
| public boolean | Returns: whether this container is a validate rootIndicates if this container is a validate root. |
| public void | layout()
Overrides java.
Deprecated
As of JDK version 1.1,
replaced by
doLayout().
|
| pack-priv void | lightweightPaint(Graphics
the graphics context to use for printing. g)Overrides java. Simulates the peer callbacks into java.awt for printing of lightweight Containers. |
| pack-priv void | lightweightPrint(Graphics
the graphics context to use for printing. g)Overrides java. Simulates the peer callbacks into java.awt for printing of lightweight Containers. |
| public void | list(PrintStream
a print stream out, int the number of spaces to indent indent)Overrides java. Prints a listing of this container to the specified output stream. |
| public void | list(PrintWriter
a print writer out, int the number of spaces to indent indent)Overrides java. Prints out a list, starting at the specified indentation, to the specified print writer. |
| public Component | locate(int x, int y)
Overrides java.
Deprecated
As of JDK version 1.1,
replaced by
getComponentAt(int, int).
Returns the component occupying the position specified (this component, or immediate child component, or null if neither of the first two occupies the location). |
| public Dimension | minimumSize()
Overrides java.
Deprecated
As of JDK version 1.1,
replaced by
getMinimumSize().
Returns the minimum size of this component. |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv int | |
| public void | paint(Graphics
the specified Graphics window g)Overrides java. Paints the container. |
| public void | |
| pack-priv void | paintHeavyweightComponents(Graphics g)
Overrides java. Prints all the heavyweight subcomponents. |
| protected String | Returns: the parameter string of this containerOverrides java. Returns a string representing the state of this |
| pack-priv void | |
| pack-priv boolean | |
| public Dimension | preferredSize()
Overrides java.
Deprecated
As of JDK version 1.1,
replaced by
getPreferredSize().
Returns the component's preferred size. |
| pack-priv void | |
| public void | print(Graphics
the specified Graphics window g)Overrides java. Prints the container. |
| public void | |
| pack-priv void | printHeavyweightComponents(Graphics g)
Overrides java. Prints all the heavyweight subcomponents. |
| protected void | processContainerEvent(ContainerEvent
the container event e)Processes container events occurring on this container by dispatching them to any registered ContainerListener objects. |
| protected void | processEvent(AWTEvent
the event e)Overrides java. Processes events on this container. |
| pack-priv void | proxyEnableEvents(long events)
This is called by lightweight components that want the containing windowed parent to enable some kind of events on their behalf. |
| private void | readObject(ObjectInputStream
the s)ObjectInputStream to readHides java. Deserializes this |
| pack-priv final void | |
| pack-priv final void | |
| pack-priv final void | |
| private void | |
| private void | |
| private void | |
| pack-priv final void | |
| pack-priv final void | |
| pack-priv final void | |
| public void | remove(int
the index of the component to be removed index)Removes the component, specified by |
| public void | |
| public void | |
| public synchronized void | removeContainerListener(ContainerListener
the container listener l)Removes the specified container listener so it no longer receives container events from this container. |
| private boolean | removeDelicately(Component comp, Container newParent, int newIndex)
Removes component comp from this container without making unnecessary changes and generating unnecessary events. |
| public void | removeNotify()
Overrides java. Makes this Container undisplayable by removing its connection to its native screen resource. |
| private void | |
| private void | reparentTraverse(ContainerPeer parentPeer, Container child)
Traverses the tree of components and reparents children heavyweight component to new heavyweight parent. |
| public void | setComponentZOrder(Component
the component to be moved comp, int the position in the container's list to
insert the component, where index)getComponentCount()
appends to the endMoves the specified component to the specified z-order index in the container. |
| public void | setFocusCycleRoot(boolean
indicates whether this Container is the root of a
focus traversal cycle focusCycleRoot)Sets whether this Container is the root of a focus traversal cycle. |
| public void | setFocusTraversalKeys(int
one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or
KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS id, Set<? extends AWTKeyStroke> the Set of AWTKeyStroke for the specified operation keystrokes)Overrides java. Sets the focus traversal keys for a given traversal operation for this Container. |
| public void | setFocusTraversalPolicy(FocusTraversalPolicy
the new focus traversal policy for this Container policy)Sets the focus traversal policy that will manage keyboard traversal of this Container's children, if this Container is a focus cycle root. |
| public final void | setFocusTraversalPolicyProvider(boolean
indicates whether this container will be used to
provide focus traversal policy provider)Sets whether this container will be used to provide focus traversal policy. |
| public void | setFont(Font
The font to become this container's font. f)Overrides java. Sets the font of this container. |
| public void | |
| private void | |
| private void | |
| public void | |
| public void | update(Graphics
the specified Graphics window g)Overrides java. Updates the container. |
| pack-priv final boolean | |
| public void | validate()
Overrides java. Validates this container and all of its subcomponents. |
| protected void | validateTree()
Recursively descends the container tree and recomputes the layout for any subtrees marked as needing it (those marked as invalid). |
| pack-priv final void | |
| private void | writeObject(ObjectOutputStream
the s)ObjectOutputStream to writeHides java. Serializes this |