|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object![]()
![]()
![]()
java.awt.Component
![]()
![]()
![]()
java.awt.Container
, MenuContainer
, Serializable

, CellRendererPane
, DefaultTreeCellEditor.EditorContainer
, JComponent
, Panel
, ScrollPane
, Window

public class Container

A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT components.
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
,
Serialized Form| Nested Class Summary | |
|---|---|
protected class |
Container.AccessibleAWTContainer
Inner class of Container used to provide default support for accessibility. |
Nested classes/interfaces inherited from class java.awt.Component ![]() |
|---|
Component.AccessibleAWTComponent |
| Field Summary |
|---|
Fields inherited from class java.awt.Component ![]() |
|---|
BOTTOM_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver ![]() |
|---|
ABORT |
| Constructor Summary | |
|---|---|
Container
Constructs a new Container. |
|
| Method Summary | ||
|---|---|---|
Component |
add
Appends the specified component to the end of this container. |
|
Component |
add
Adds the specified component to this container at the given position. |
|
void |
add
Adds the specified component to the end of this container. |
|
void |
add
Adds the specified component to this container with the specified constraints at the specified index. |
|
Component |
add
Adds the specified component to this container. |
|
void |
addContainerListener
Adds the specified container listener to receive container events from this container. |
|
protected void |
addImpl
Adds the specified component to this container at the specified index. |
|
void |
addNotify
Makes this Container displayable by connecting it to a native screen resource. |
|
void |
addPropertyChangeListener
Adds a PropertyChangeListener to the listener list. |
|
void |
addPropertyChangeListener
Adds a PropertyChangeListener to the listener list for a specific property. |
|
void |
applyComponentOrientation
Sets the ComponentOrientation property of this container
and all components contained within it. |
|
boolean |
areFocusTraversalKeysSet
Returns whether the Set of focus traversal keys for the given focus traversal operation has been explicitly defined for this Container. |
|
int |
countComponents
Deprecated. As of JDK version 1.1, replaced by getComponentCount(). |
|
void |
deliverEvent
Deprecated. As of JDK version 1.1, replaced by dispatchEvent(AWTEvent e) |
|
void |
doLayout
Causes this container to lay out its components. |
|
Component |
findComponentAt
Locates the visible child component that contains the specified position. |
|
Component |
findComponentAt
Locates the visible child component that contains the specified point. |
|
float |
getAlignmentX
Returns the alignment along the x axis. |
|
float |
getAlignmentY
Returns the alignment along the y axis. |
|
Component |
getComponent
Gets the nth component in this container. |
|
Component |
getComponentAt
Locates the component that contains the x,y position. |
|
Component |
getComponentAt
Gets the component that contains the specified point. |
|
int |
getComponentCount
Gets the number of components in this panel. |
|
Component |
getComponents
Gets all the components in this container. |
|
int |
getComponentZOrder
Returns the z-order index of the component inside the container. |
|
ContainerListener |
getContainerListeners
Returns an array of all the container listeners registered on this container. |
|
Set |
getFocusTraversalKeys
Returns the Set of focus traversal keys for a given traversal operation for this Container. |
|
FocusTraversalPolicy |
getFocusTraversalPolicy
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. |
|
Insets |
getInsets
Determines the insets of this container, which indicate the size of the container's border. |
|
LayoutManager |
getLayout
Gets the layout manager for this container. |
|
|
getListeners
Returns an array of all the objects currently registered as FooListeners
upon this Container. |
|
Dimension |
getMaximumSize
Returns the maximum size of this container. |
|
Dimension |
getMinimumSize
Returns the minimum size of this container. |
|
Point |
getMousePosition
Returns the position of the mouse pointer in this Container's
coordinate space if the Container is under the mouse pointer,
otherwise returns null. |
|
Dimension |
getPreferredSize
Returns the preferred size of this container. |
|
Insets |
insets
Deprecated. As of JDK version 1.1, replaced by getInsets(). |
|
void |
invalidate
Invalidates the container. |
|
boolean |
isAncestorOf
Checks if the component is contained in the component hierarchy of this container. |
|
boolean |
isFocusCycleRoot
Returns whether this Container is the root of a focus traversal cycle. |
|
boolean |
isFocusCycleRoot
Returns whether the specified Container is the focus cycle root of this Container's focus traversal cycle. |
|
boolean |
isFocusTraversalPolicyProvider
Returns whether this container provides focus traversal policy. |
|
boolean |
isFocusTraversalPolicySet
Returns whether the focus traversal policy has been explicitly set for this Container. |
|
void |
layout
Deprecated. As of JDK version 1.1, replaced by doLayout(). |
|
void |
list
Prints a listing of this container to the specified output stream. |
|
void |
list
Prints out a list, starting at the specified indentation, to the specified print writer. |
|
Component |
locate
Deprecated. As of JDK version 1.1, replaced by getComponentAt(int, int). |
|
Dimension |
minimumSize
Deprecated. As of JDK version 1.1, replaced by getMinimumSize(). |
|
void |
paint
Paints the container. |
|
void |
paintComponents
Paints each of the components in this container. |
|
protected String |
paramString
Returns a string representing the state of this Container. |
|
Dimension |
preferredSize
Deprecated. As of JDK version 1.1, replaced by getPreferredSize(). |
|
void |
print
Prints the container. |
|
void |
printComponents
Prints each of the components in this container. |
|
protected void |
processContainerEvent
Processes container events occurring on this container by dispatching them to any registered ContainerListener objects. |
|
protected void |
processEvent
Processes events on this container. |
|
void |
remove
Removes the specified component from this container. |
|
void |
remove
Removes the component, specified by index,
from this container. |
|
void |
removeAll
Removes all the components from this container. |
|
void |
removeContainerListener
Removes the specified container listener so it no longer receives container events from this container. |
|
void |
removeNotify
Makes this Container undisplayable by removing its connection to its native screen resource. |
|
void |
setComponentZOrder
Moves the specified component to the specified z-order index in the container. |
|
void |
setFocusCycleRoot
Sets whether this Container is the root of a focus traversal cycle. |
|
void |
setFocusTraversalKeys
Sets the focus traversal keys for a given traversal operation for this Container. |
|
void |
setFocusTraversalPolicy | |