Container (Java Platform SE 7 ) (original) (raw)

Modifier and Type

Method and Description

[Component](../../java/awt/Component.html "class in java.awt")

**[add](../../java/awt/Container.html#add%28java.awt.Component%29)**([Component](../../java/awt/Component.html "class in java.awt") comp)

Appends the specified component to the end of this container.

[Component](../../java/awt/Component.html "class in java.awt")

**[add](../../java/awt/Container.html#add%28java.awt.Component,%20int%29)**([Component](../../java/awt/Component.html "class in java.awt") comp, int index)

Adds the specified component to this container at the given position.

void

**[add](../../java/awt/Container.html#add%28java.awt.Component,%20java.lang.Object%29)**([Component](../../java/awt/Component.html "class in java.awt") comp,[Object](../../java/lang/Object.html "class in java.lang") constraints)

Adds the specified component to the end of this container.

void

**[add](../../java/awt/Container.html#add%28java.awt.Component,%20java.lang.Object,%20int%29)**([Component](../../java/awt/Component.html "class in java.awt") comp,[Object](../../java/lang/Object.html "class in java.lang") constraints, int index)

Adds the specified component to this container with the specified constraints at the specified index.

[Component](../../java/awt/Component.html "class in java.awt")

**[add](../../java/awt/Container.html#add%28java.lang.String,%20java.awt.Component%29)**([String](../../java/lang/String.html "class in java.lang") name,[Component](../../java/awt/Component.html "class in java.awt") comp)

Adds the specified component to this container.

void

**[addContainerListener](../../java/awt/Container.html#addContainerListener%28java.awt.event.ContainerListener%29)**([ContainerListener](../../java/awt/event/ContainerListener.html "interface in java.awt.event") l)

Adds the specified container listener to receive container events from this container.

protected void

**[addImpl](../../java/awt/Container.html#addImpl%28java.awt.Component,%20java.lang.Object,%20int%29)**([Component](../../java/awt/Component.html "class in java.awt") comp,[Object](../../java/lang/Object.html "class in java.lang") constraints, int index)

Adds the specified component to this container at the specified index.

void

**[addNotify](../../java/awt/Container.html#addNotify%28%29)**()

Makes this Container displayable by connecting it to a native screen resource.

void

**[addPropertyChangeListener](../../java/awt/Container.html#addPropertyChangeListener%28java.beans.PropertyChangeListener%29)**([PropertyChangeListener](../../java/beans/PropertyChangeListener.html "interface in java.beans") listener)

Adds a PropertyChangeListener to the listener list.

void

**[addPropertyChangeListener](../../java/awt/Container.html#addPropertyChangeListener%28java.lang.String,%20java.beans.PropertyChangeListener%29)**([String](../../java/lang/String.html "class in java.lang") propertyName,[PropertyChangeListener](../../java/beans/PropertyChangeListener.html "interface in java.beans") listener)

Adds a PropertyChangeListener to the listener list for a specific property.

void

**[applyComponentOrientation](../../java/awt/Container.html#applyComponentOrientation%28java.awt.ComponentOrientation%29)**([ComponentOrientation](../../java/awt/ComponentOrientation.html "class in java.awt") o)

Sets the ComponentOrientation property of this container and all components contained within it.

boolean

**[areFocusTraversalKeysSet](../../java/awt/Container.html#areFocusTraversalKeysSet%28int%29)**(int id)

Returns whether the Set of focus traversal keys for the given focus traversal operation has been explicitly defined for this Container.

int

**[countComponents](../../java/awt/Container.html#countComponents%28%29)**()

Deprecated.

As of JDK version 1.1, replaced by getComponentCount().

void

**[deliverEvent](../../java/awt/Container.html#deliverEvent%28java.awt.Event%29)**([Event](../../java/awt/Event.html "class in java.awt") e)

Deprecated.

As of JDK version 1.1, replaced by dispatchEvent(AWTEvent e)

void

**[doLayout](../../java/awt/Container.html#doLayout%28%29)**()

Causes this container to lay out its components.

[Component](../../java/awt/Component.html "class in java.awt")

**[findComponentAt](../../java/awt/Container.html#findComponentAt%28int,%20int%29)**(int x, int y)

Locates the visible child component that contains the specified position.

[Component](../../java/awt/Component.html "class in java.awt")

**[findComponentAt](../../java/awt/Container.html#findComponentAt%28java.awt.Point%29)**([Point](../../java/awt/Point.html "class in java.awt") p)

Locates the visible child component that contains the specified point.

float

**[getAlignmentX](../../java/awt/Container.html#getAlignmentX%28%29)**()

Returns the alignment along the x axis.

float

**[getAlignmentY](../../java/awt/Container.html#getAlignmentY%28%29)**()

Returns the alignment along the y axis.

[Component](../../java/awt/Component.html "class in java.awt")

**[getComponent](../../java/awt/Container.html#getComponent%28int%29)**(int n)

Gets the nth component in this container.

[Component](../../java/awt/Component.html "class in java.awt")

**[getComponentAt](../../java/awt/Container.html#getComponentAt%28int,%20int%29)**(int x, int y)

Locates the component that contains the x,y position.

[Component](../../java/awt/Component.html "class in java.awt")

**[getComponentAt](../../java/awt/Container.html#getComponentAt%28java.awt.Point%29)**([Point](../../java/awt/Point.html "class in java.awt") p)

Gets the component that contains the specified point.

int

**[getComponentCount](../../java/awt/Container.html#getComponentCount%28%29)**()

Gets the number of components in this panel.

[Component](../../java/awt/Component.html "class in java.awt")[]

**[getComponents](../../java/awt/Container.html#getComponents%28%29)**()

Gets all the components in this container.

int

**[getComponentZOrder](../../java/awt/Container.html#getComponentZOrder%28java.awt.Component%29)**([Component](../../java/awt/Component.html "class in java.awt") comp)

Returns the z-order index of the component inside the container.

[ContainerListener](../../java/awt/event/ContainerListener.html "interface in java.awt.event")[]

**[getContainerListeners](../../java/awt/Container.html#getContainerListeners%28%29)**()

Returns an array of all the container listeners registered on this container.

[Set](../../java/util/Set.html "interface in java.util")<[AWTKeyStroke](../../java/awt/AWTKeyStroke.html "class in java.awt")>

**[getFocusTraversalKeys](../../java/awt/Container.html#getFocusTraversalKeys%28int%29)**(int id)

Returns the Set of focus traversal keys for a given traversal operation for this Container.

[FocusTraversalPolicy](../../java/awt/FocusTraversalPolicy.html "class in java.awt")

**[getFocusTraversalPolicy](../../java/awt/Container.html#getFocusTraversalPolicy%28%29)**()

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](../../java/awt/Insets.html "class in java.awt")

**[getInsets](../../java/awt/Container.html#getInsets%28%29)**()

Determines the insets of this container, which indicate the size of the container's border.

[LayoutManager](../../java/awt/LayoutManager.html "interface in java.awt")

**[getLayout](../../java/awt/Container.html#getLayout%28%29)**()

Gets the layout manager for this container.

<T extends [EventListener](../../java/util/EventListener.html "interface in java.util")> T[]

**[getListeners](../../java/awt/Container.html#getListeners%28java.lang.Class%29)**([Class](../../java/lang/Class.html "class in java.lang")<T> listenerType)

Returns an array of all the objects currently registered as _Foo_Listeners upon this Container.

[Dimension](../../java/awt/Dimension.html "class in java.awt")

**[getMaximumSize](../../java/awt/Container.html#getMaximumSize%28%29)**()

Returns the maximum size of this container.

[Dimension](../../java/awt/Dimension.html "class in java.awt")

**[getMinimumSize](../../java/awt/Container.html#getMinimumSize%28%29)**()

Returns the minimum size of this container.

[Point](../../java/awt/Point.html "class in java.awt")

**[getMousePosition](../../java/awt/Container.html#getMousePosition%28boolean%29)**(boolean allowChildren)

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](../../java/awt/Dimension.html "class in java.awt")

**[getPreferredSize](../../java/awt/Container.html#getPreferredSize%28%29)**()

Returns the preferred size of this container.

[Insets](../../java/awt/Insets.html "class in java.awt")

**[insets](../../java/awt/Container.html#insets%28%29)**()

Deprecated.

As of JDK version 1.1, replaced by getInsets().

void

**[invalidate](../../java/awt/Container.html#invalidate%28%29)**()

Invalidates the container.

boolean

**[isAncestorOf](../../java/awt/Container.html#isAncestorOf%28java.awt.Component%29)**([Component](../../java/awt/Component.html "class in java.awt") c)

Checks if the component is contained in the component hierarchy of this container.

boolean

**[isFocusCycleRoot](../../java/awt/Container.html#isFocusCycleRoot%28%29)**()

Returns whether this Container is the root of a focus traversal cycle.

boolean

**[isFocusCycleRoot](../../java/awt/Container.html#isFocusCycleRoot%28java.awt.Container%29)**([Container](../../java/awt/Container.html "class in java.awt") container)

Returns whether the specified Container is the focus cycle root of this Container's focus traversal cycle.

boolean

**[isFocusTraversalPolicyProvider](../../java/awt/Container.html#isFocusTraversalPolicyProvider%28%29)**()

Returns whether this container provides focus traversal policy.

boolean

**[isFocusTraversalPolicySet](../../java/awt/Container.html#isFocusTraversalPolicySet%28%29)**()

Returns whether the focus traversal policy has been explicitly set for this Container.

boolean

**[isValidateRoot](../../java/awt/Container.html#isValidateRoot%28%29)**()

Indicates if this container is a validate root.

void

**[layout](../../java/awt/Container.html#layout%28%29)**()

Deprecated.

As of JDK version 1.1, replaced by doLayout().

void

**[list](../../java/awt/Container.html#list%28java.io.PrintStream,%20int%29)**([PrintStream](../../java/io/PrintStream.html "class in java.io") out, int indent)

Prints a listing of this container to the specified output stream.

void

**[list](../../java/awt/Container.html#list%28java.io.PrintWriter,%20int%29)**([PrintWriter](../../java/io/PrintWriter.html "class in java.io") out, int indent)

Prints out a list, starting at the specified indentation, to the specified print writer.

[Component](../../java/awt/Component.html "class in java.awt")

**[locate](../../java/awt/Container.html#locate%28int,%20int%29)**(int x, int y)

Deprecated.

As of JDK version 1.1, replaced by getComponentAt(int, int).

[Dimension](../../java/awt/Dimension.html "class in java.awt")

**[minimumSize](../../java/awt/Container.html#minimumSize%28%29)**()

Deprecated.

As of JDK version 1.1, replaced by getMinimumSize().

void

**[paint](../../java/awt/Container.html#paint%28java.awt.Graphics%29)**([Graphics](../../java/awt/Graphics.html "class in java.awt") g)

Paints the container.

void

**[paintComponents](../../java/awt/Container.html#paintComponents%28java.awt.Graphics%29)**([Graphics](../../java/awt/Graphics.html "class in java.awt") g)

Paints each of the components in this container.

protected [String](../../java/lang/String.html "class in java.lang")

**[paramString](../../java/awt/Container.html#paramString%28%29)**()

Returns a string representing the state of this Container.

[Dimension](../../java/awt/Dimension.html "class in java.awt")

**[preferredSize](../../java/awt/Container.html#preferredSize%28%29)**()

Deprecated.

As of JDK version 1.1, replaced by getPreferredSize().

void

**[print](../../java/awt/Container.html#print%28java.awt.Graphics%29)**([Graphics](../../java/awt/Graphics.html "class in java.awt") g)

Prints the container.

void

**[printComponents](../../java/awt/Container.html#printComponents%28java.awt.Graphics%29)**([Graphics](../../java/awt/Graphics.html "class in java.awt") g)

Prints each of the components in this container.

protected void

**[processContainerEvent](../../java/awt/Container.html#processContainerEvent%28java.awt.event.ContainerEvent%29)**([ContainerEvent](../../java/awt/event/ContainerEvent.html "class in java.awt.event") e)

Processes container events occurring on this container by dispatching them to any registered ContainerListener objects.

protected void

**[processEvent](../../java/awt/Container.html#processEvent%28java.awt.AWTEvent%29)**([AWTEvent](../../java/awt/AWTEvent.html "class in java.awt") e)

Processes events on this container.

void

**[remove](../../java/awt/Container.html#remove%28java.awt.Component%29)**([Component](../../java/awt/Component.html "class in java.awt") comp)

Removes the specified component from this container.

void

**[remove](../../java/awt/Container.html#remove%28int%29)**(int index)

Removes the component, specified by index, from this container.

void

**[removeAll](../../java/awt/Container.html#removeAll%28%29)**()

Removes all the components from this container.

void

**[removeContainerListener](../../java/awt/Container.html#removeContainerListener%28java.awt.event.ContainerListener%29)**([ContainerListener](../../java/awt/event/ContainerListener.html "interface in java.awt.event") l)

Removes the specified container listener so it no longer receives container events from this container.

void

**[removeNotify](../../java/awt/Container.html#removeNotify%28%29)**()

Makes this Container undisplayable by removing its connection to its native screen resource.

void

**[setComponentZOrder](../../java/awt/Container.html#setComponentZOrder%28java.awt.Component,%20int%29)**([Component](../../java/awt/Component.html "class in java.awt") comp, int index)

Moves the specified component to the specified z-order index in the container.

void

**[setFocusCycleRoot](../../java/awt/Container.html#setFocusCycleRoot%28boolean%29)**(boolean focusCycleRoot)

Sets whether this Container is the root of a focus traversal cycle.

void

**[setFocusTraversalKeys](../../java/awt/Container.html#setFocusTraversalKeys%28int,%20java.util.Set%29)**(int id,[Set](../../java/util/Set.html "interface in java.util")<? extends [AWTKeyStroke](../../java/awt/AWTKeyStroke.html "class in java.awt")> keystrokes)

Sets the focus traversal keys for a given traversal operation for this Container.

void

**[setFocusTraversalPolicy](../../java/awt/Container.html#setFocusTraversalPolicy%28java.awt.FocusTraversalPolicy%29)**([FocusTraversalPolicy](../../java/awt/FocusTraversalPolicy.html "class in java.awt") policy)

Sets the focus traversal policy that will manage keyboard traversal of this Container's children, if this Container is a focus cycle root.

void

**[setFocusTraversalPolicyProvider](../../java/awt/Container.html#setFocusTraversalPolicyProvider%28boolean%29)**(boolean provider)

Sets whether this container will be used to provide focus traversal policy.

void

**[setFont](../../java/awt/Container.html#setFont%28java.awt.Font%29)**([Font](../../java/awt/Font.html "class in java.awt") f)

Sets the font of this container.

void

**[setLayout](../../java/awt/Container.html#setLayout%28java.awt.LayoutManager%29)**([LayoutManager](../../java/awt/LayoutManager.html "interface in java.awt") mgr)

Sets the layout manager for this container.

void

**[transferFocusDownCycle](../../java/awt/Container.html#transferFocusDownCycle%28%29)**()

Transfers the focus down one focus traversal cycle.

void

**[update](../../java/awt/Container.html#update%28java.awt.Graphics%29)**([Graphics](../../java/awt/Graphics.html "class in java.awt") g)

Updates the container.

void

**[validate](../../java/awt/Container.html#validate%28%29)**()

Validates this container and all of its subcomponents.

protected void

**[validateTree](../../java/awt/Container.html#validateTree%28%29)**()

Recursively descends the container tree and recomputes the layout for any subtrees marked as needing it (those marked as invalid).