Java Reference
In-Depth Information
Table 26-3
Commonly Used Methods of the Container Class
RETURNS
NAME
DESCRIPTION
Component add(Component comp)
Adds the specified component to this
container.
Component add(Component comp, int index)
Adds the specified component to this
container at the given position.
void add(Component comp, Object constraints)
Adds the specified component to the
end of this container with the given
constraints.
void add(Component comp, Object constraints, int index)
Adds the specified component to this
container withthe specified
constraints at the specified
location.
Component add(String name, Component comp)
Adds the component specified by its
name to this container.
void addContainerListener(ContainerListener l)
Adds the specified container listener
to receive container events from this
container.
void addNotify() Makes this Container displayable by
connecting it to a native screen
resource.
Component findComponentAt(int x, int y)
Locates the child component that
contains the specified position.
Component findComponentAt(Point p)
Locates the child component that
contains the specified point.
float getAlignmentX()
Returns the x axis alignment.
float getAlignmentY()
Returns the y axis alignment.
Component getComponent(int n)
Returns the nth component in this
container.
Component
getComponentAt(int x, int y)
Locates the component that contains
the specified x,y position.
Component
getComponentAt(Point p)
Gets the component that contains the
specified point.
(continues)
 
Search WWH ::




Custom Search