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.
- add(Component)
- Adds the specified component to this container.
- add(Component, int)
- Adds the specified component to this container at the given position.
- add(String, Component)
- Adds the specified component to this container.
- addNotify()
- Notifies the container to create a peer.
- countComponents()
- Returns the number of components in this panel.
- deliverEvent(Event)
- Delivers an event.
- getComponent(int)
- Gets the nth component in this container.
- getComponents()
- Gets all the components in this container.
- getLayout()
- Gets the layout manager for this container.
- insets()
- Returns the insets of the container.
- layout()
- Does a layout on this Container.
- list(PrintStream, int)
- Prints out a list, starting at the specified indention, to the specified
out stream.
- locate(int, int)
- Locates the component that contains the x,y position.
- minimumSize()
- Returns the minimum size of this container.
- paintComponents(Graphics)
- Paints the components in this container.
- paramString()
- Returns the parameter String of this Container.
- preferredSize()
- Returns the preferred size of this container.
- printComponents(Graphics)
- Prints the components in this container.
- remove(Component)
- Removes the specified component from this container.
- removeAll()
- Removes all the components from this container.
- removeNotify()
- Notifies the container to remove its peer.
- setLayout(LayoutManager)
- Sets the layout manager for this container.
- validate()
- Validates this Container and all of the components contained within it.
countComponents
public int countComponents()
- Returns the number of components in this panel.
- See Also:
- getComponent
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.
getComponents
public synchronized Component[] getComponents()
- Gets all the components in this container.
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
add
public Component add(Component comp)
- Adds the specified component to this container.
- Parameters:
- comp - the component to be added
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
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
remove
public synchronized void remove(Component comp)
- Removes the specified component from this container.
- Parameters:
- comp - the component to be removed
- See Also:
- add
removeAll
public synchronized void removeAll()
- Removes all the components from this container.
- See Also:
- add, remove
getLayout
public LayoutManager getLayout()
- Gets the layout manager for this container.
- See Also:
- layout, setLayout
setLayout
public void setLayout(LayoutManager mgr)
- Sets the layout manager for this container.
- Parameters:
- mgr - the specified layout manager
- See Also:
- layout, getLayout
layout
public synchronized void layout()
- Does a layout on this Container.
- Overrides:
- layout in class Component
- See Also:
- setLayout
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
preferredSize
public synchronized Dimension preferredSize()
- Returns the preferred size of this container.
- Overrides:
- preferredSize in class Component
- See Also:
- minimumSize
minimumSize
public synchronized Dimension minimumSize()
- Returns the minimum size of this container.
- Overrides:
- minimumSize in class Component
- See Also:
- preferredSize
paintComponents
public void paintComponents(Graphics g)
- Paints the components in this container.
- Parameters:
- g - the specified Graphics window
- See Also:
- paint, paintAll
printComponents
public void printComponents(Graphics g)
- Prints the components in this container.
- Parameters:
- g - the specified Graphics window
- See Also:
- print, printAll
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
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
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
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
paramString
protected String paramString()
- Returns the parameter String of this Container.
- Overrides:
- paramString in class Component
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