Class java.awt.Container
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.awt.Container

java.lang.Object
|
   +----java.awt.Component
|
           +----java.awt.Container

public class Container
extends Component
A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT components.

Method Index

 o add(Component)
Adds the specified component to this container.
 o add(Component, int)
Adds the specified component to this container at the given position.
 o add(String, Component)
Adds the specified component to this container.
 o addNotify()
Notifies the container to create a peer.
 o countComponents()
Returns the number of components in this panel.
 o deliverEvent(Event)
Delivers an event.
 o getComponent(int)
Gets the nth component in this container.
 o getComponents()
Gets all the components in this container.
 o getLayout()
Gets the layout manager for this container.
 o insets()
Returns the insets of the container.
 o layout()
Does a layout on this Container.
 o list(PrintStream, int)
Prints out a list, starting at the specified indention, to the specified out stream.
 o locate(int, int)
Locates the component that contains the x,y position.
 o minimumSize()
Returns the minimum size of this container.
 o paintComponents(Graphics)
Paints the components in this container.
 o paramString()
Returns the parameter String of this Container.
 o preferredSize()
Returns the preferred size of this container.
 o printComponents(Graphics)
Prints the components in this container.
 o remove(Component)
Removes the specified component from this container.
 o removeAll()
Removes all the components from this container.
 o removeNotify()
Notifies the container to remove its peer.
 o setLayout(LayoutManager)
Sets the layout manager for this container.
 o validate()
Validates this Container and all of the components contained within it.

Methods

 o countComponents
public int countComponents()
Returns the number of components in this panel.
See Also:
getComponent
 o getComponent
public synchronized Component getComponent(int n)
Gets the nth component in this container.
Parameters:
n - the number of the component to get
Throws: ArrayIndexOutOfBoundsException
If the nth value does not exist.
 o getComponents
public synchronized Component[] getComponents()
Gets all the components in this container.
 o insets
public Insets insets()
Returns the insets of the container. The insets indicate the size of the border of the container. A Frame, for example, will have a top inset that corresponds to the height of the Frame's title bar.
See Also:
LayoutManager
 o add
public Component add(Component comp)
Adds the specified component to this container.
Parameters:
comp - the component to be added
 o add
public synchronized Component add(Component comp,
                                    int pos)
Adds the specified component to this container at the given position.
Parameters:
comp - the component to be added
pos - the position at which to insert the component. -1 means insert at the end.
See Also:
remove
 o add
public synchronized Component add(String name,
Component comp)
Adds the specified component to this container. The component is also added to the layout manager of this container using the name specified .
Parameters:
name - the component name
comp - the component to be added
See Also:
remove, LayoutManager
 o remove
public synchronized void remove(Component comp)
Removes the specified component from this container.
Parameters:
comp - the component to be removed
See Also:
add
 o removeAll
public synchronized void removeAll()
Removes all the components from this container.
See Also:
add, remove
 o getLayout
public LayoutManager getLayout()
Gets the layout manager for this container.
See Also:
layout, setLayout
 o setLayout
public void setLayout(LayoutManager mgr)
Sets the layout manager for this container.
Parameters:
mgr - the specified layout manager
See Also:
layout, getLayout
 o layout
public synchronized void layout()
Does a layout on this Container.
Overrides:
layout in class Component
See Also:
setLayout
 o validate
public synchronized void validate()
Validates this Container and all of the components contained within it.
Overrides:
validate in class Component
See Also:
validate, invalidate
 o preferredSize
public synchronized Dimension preferredSize()
Returns the preferred size of this container.
Overrides:
preferredSize in class Component
See Also:
minimumSize
 o minimumSize
public synchronized Dimension minimumSize()
Returns the minimum size of this container.
Overrides:
minimumSize in class Component
See Also:
preferredSize
 o paintComponents
public void paintComponents(Graphics g)
Paints the components in this container.
Parameters:
g - the specified Graphics window
See Also:
paint, paintAll
 o printComponents
public void printComponents(Graphics g)
Prints the components in this container.
Parameters:
g - the specified Graphics window
See Also:
print, printAll
 o deliverEvent
public void deliverEvent(Event e)
Delivers an event. The appropriate component is located and the event is delivered to it.
Parameters:
e - the event
Overrides:
deliverEvent in class Component
See Also:
handleEvent, postEvent
 o locate
public Component locate(int x,
                          int y)
Locates the component that contains the x,y position.
Parameters:
x - the x coordinate
y - the y coordinate
Returns:
null if the component is not within the x and y coordinates; returns the component otherwise.
Overrides:
locate in class Component
See Also:
inside
 o addNotify
public synchronized void addNotify()
Notifies the container to create a peer. It will also notify the components contained in this container.
Overrides:
addNotify in class Component
See Also:
removeNotify
 o removeNotify
public synchronized void removeNotify()
Notifies the container to remove its peer. It will also notify the components contained in this container.
Overrides:
removeNotify in class Component
See Also:
addNotify
 o paramString
protected String paramString()
Returns the parameter String of this Container.
Overrides:
paramString in class Component
 o list
public void list(PrintStream out,
                   int indent)
Prints out a list, starting at the specified indention, to the specified out stream.
Parameters:
out - the Stream name
indent - the start of the list
Overrides:
list in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index