|
|
|
|
The
|
| Method | Description |
|---|---|
|
Gets the preferred size of this component. |
|
Gets the minimum size of this component. |
Each Component within a Container tells the Container's layout manager what
size it would prefer to be, and what minimum size it needs to be.
Typically, a layout manager will cycle through the Components within the
Container to determine the preferred and minimum sizes for the container
itself.
Container Class Containers implement a number of methods that affect their interactions
with layout managers:
| Method | Description |
|---|---|
|
Adds the specified component to the end of this container. |
|
Adds the specified component to this container at the
given position. The index is the position at which to insert the
component, or -1 to insert the component at the end. |
|
Adds the specified component to the end of this container. Also notifies the layout manager to add the component to this container's layout using the specified constraints object. |
|
Adds the specified component to this container with the specified constraints at the specified index. Also notifies the layout manager to add the component to the this container's layout using the specified constraints object. |
|
Adds the specified component to this container at the
specified index. This method also notifies the layout manager to add
the component to this container's layout using the specified
constraints object.
This is the method to override if a program needs to track every add request to a container. An overriding method should usually include a call to the superclass's version of the method:
|
|
Gets the nth component in this container. |
|
Gets all the components in this container. |
|
Gets the number of components in this panel. |
|
Determines the insets of this container, which indicate
the size of the container's border. A Frame object, for example, has a top inset that
corresponds to the height of the frame's title bar. |
|
Removes the component, specified by index,
from this container. |
|
Removes the specified component from this container. |
|
Removes all the components from this container. |
|
Gets the layout manager for this container. |
|
Sets the layout manager for this container. |
|
Causes this container to lay out its components. Most
programs should not call this method directly, but should invoke the validate
method instead. |
|
Invalidates the container. The container and all parents above it are marked as needing to be laid out. This method can be called often, so it needs to execute quickly. |
|
Validates this container and all of its subcomponents. AWT uses validate to cause a container to lay out its
subcomponents again after the components it contains have been added
to or modified. |
|
Recursively descends the container tree and recomputes
the layout for any subtrees marked as needing it (those marked as
invalid). Synchronization should be provided by the method that calls
this one: validate. |
|
This page was last modified on 02 October, 2007 |