Example usage for Java java.awt Container fields, constructors, methods, implement or subclass
The text is from its open source code.
Container() Constructs a new Container. |
Component | add(Component comp) Appends the specified component to the end of this container. |
Component | add(String name, 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. |
void | add(Component comp, Object constraints, int index) Adds the specified component to this container with the specified constraints at the specified index. |
void | addContainerListener(ContainerListener l) Adds the specified container listener to receive container events from this container. |
void | addFocusListener(FocusListener l) Adds the specified focus listener to receive focus events from this component when this component gains input focus. |
void | addHierarchyBoundsListener(HierarchyBoundsListener l) Adds the specified hierarchy bounds listener to receive hierarchy bounds events from this component when the hierarchy to which this container belongs changes. |
void | addKeyListener(KeyListener l) Adds the specified key listener to receive key events from this component. |
void | addMouseWheelListener(MouseWheelListener l) Adds the specified mouse wheel listener to receive mouse wheel events from this component. |
void | addNotify() Makes this Container displayable by connecting it to a native screen resource. |
void | addPropertyChangeListener(PropertyChangeListener listener) Adds a PropertyChangeListener to the listener list. |
void | applyComponentOrientation(ComponentOrientation o) Sets the ComponentOrientation property of this container and all components contained within it. |
int | countComponents() Returns the number of components in this container. |
boolean | dispatchEvent(AWTEvent e) Dispatches an event to a sub-component if necessary, and returns whether or not the event was forwarded to a sub-component. |
void | doLayout() Causes this container to lay out its components. |
Color | getBackground() Gets the background color of this component. |
Rectangle | getBounds(Rectangle rv) Stores the bounds of this component into "return value" rv and return rv. |
Rectangle | getBounds() Gets the bounds of this component in the form of a Rectangle object. |
Class> | getClass() Returns the runtime class of this Object . |
Component | getComponent(int n) Gets the nth component in this container. |
Component | getComponentAt(Point p) Gets the component that contains the specified point. |
int | getComponentCount() Gets the number of components in this panel. |
ComponentListener[] | getComponentListeners() Returns an array of all the component listeners registered on this component. |
ComponentOrientation | getComponentOrientation() Retrieves the language-sensitive orientation that is to be used to order the elements or text within this component. |
Component[] | getComponents() Gets all the components in this container. |
ContainerListener[] | getContainerListeners() Returns an array of all the container listeners registered on this container. |
Cursor | getCursor() Gets the cursor set in the component. |
Container | getFocusCycleRootAncestor() Returns the Container which is the focus cycle root of this Component's focus traversal cycle. |
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. |
GraphicsConfiguration | getGraphicsConfiguration() Gets the GraphicsConfiguration associated with this Component . |
int | getHeight() Returns the current height of this component. |
Insets | getInsets() Determines the insets of this container, which indicate the size of the container's border. |
KeyListener[] | getKeyListeners() Returns an array of all the key listeners registered on this component. |
LayoutManager | getLayout() Gets the layout manager for this container. |
Point | getLocationOnScreen() Gets the location of this component in the form of a point specifying the component's top-left corner in the screen's coordinate space. |
MouseListener[] | getMouseListeners() Returns an array of all the mouse listeners registered on this component. |
MouseMotionListener[] | getMouseMotionListeners() Returns an array of all the mouse motion listeners registered on this component. |
MouseWheelListener[] | getMouseWheelListeners() Returns an array of all the mouse wheel listeners registered on this component. |
String | getName() Gets the name of the component. |
Container | getParent() Gets the parent of this component. |
Dimension | getPreferredSize() Returns the preferred size of this container. |
Dimension | getSize() Returns the size of this component in the form of a Dimension object. |
Object | getTreeLock() Gets this component's locking object (the object that owns the thread synchronization monitor) for AWT component-tree and layout operations. |
int | getWidth() Returns the current width of this component. |
int | getX() Returns the current x coordinate of the components origin. |
int | getY() Returns the current y coordinate of the components origin. |
Insets | insets() Returns the insets for this container. |
void | invalidate() Invalidates the container. |
boolean | isAncestorOf(Component c) Checks if the component is contained in the component hierarchy of this container. |
boolean | isDisplayable() Determines whether this component is displayable. |
boolean | isEnabled() Determines whether this component is enabled. |
boolean | isFocusable() Returns whether this Component can be focused. |
boolean | isFocusCycleRoot() Returns whether this Container is the root of a focus traversal cycle. |
boolean | isFocusTraversalPolicyProvider() Returns whether this container provides focus traversal policy. |
boolean | isShowing() Determines whether this component is showing on screen. |
boolean | isVisible() Determines whether this component should be visible when its parent is visible. |
void | paintAll(Graphics g) Paints this component and all of its subcomponents. |
void | paintComponents(Graphics g) Paints each of the components in this container. |
void | remove(int index) Removes the component, specified by index , from this container. |
void | remove(Component comp) Removes the specified component from this container. |
void | removeAll() Removes all the components from this container. |
void | removeComponentListener(ComponentListener l) Removes the specified component listener so that it no longer receives component events from this component. |
void | removeContainerListener(ContainerListener l) Removes the specified container listener so it no longer receives container events from this container. |
void | removeHierarchyBoundsListener(HierarchyBoundsListener l) Removes the specified hierarchy bounds listener so that it no longer receives hierarchy bounds events from this component. |
void | removeKeyListener(KeyListener l) Removes the specified key listener so that it no longer receives key events from this component. |
void | removeMouseListener(MouseListener l) Removes the specified mouse listener so that it no longer receives mouse events from this component. |
void | removeMouseMotionListener(MouseMotionListener l) Removes the specified mouse motion listener so that it no longer receives mouse motion events from this component. |
void | removeMouseWheelListener(MouseWheelListener l) Removes the specified mouse wheel listener so that it no longer receives mouse wheel events from this component. |
void | repaint() Repaints this component. |
void | revalidate() Revalidates the component hierarchy up to the nearest validate root. |
void | setBackground(Color c) Sets the background color of this component. |
void | setComponentOrientation(ComponentOrientation o) Sets the language-sensitive orientation that is to be used to order the elements or text within this component. |
void | setCursor(Cursor cursor) Sets the cursor image to the specified cursor. |
void | setEnabled(boolean b) Enables or disables this component, depending on the value of the parameter b . |
void | setFocusCycleRoot(boolean focusCycleRoot) Sets whether this Container is the root of a focus traversal cycle. |
void | setFocusTraversalKeys(int id, Set extends AWTKeyStroke> keystrokes) Sets the focus traversal keys for a given traversal operation for this Container. |
void | setFont(Font f) Sets the font of this container. |
void | setLayout(LayoutManager mgr) Sets the layout manager for this container. |
void | setLocation(Point p) Moves this component to a new location. |
void | setLocation(int x, int y) Moves this component to a new location. |
void | setMaximumSize(Dimension maximumSize) Sets the maximum size of this component to a constant value. |
void | setMinimumSize(Dimension minimumSize) Sets the minimum size of this component to a constant value. |
void | setPreferredSize(Dimension preferredSize) Sets the preferred size of this component to a constant value. |
void | setSize(int width, int height) Resizes this component so that it has width width and height height . |
void | setSize(Dimension d) Resizes this component so that it has width d.width and height d.height . |
void | setVisible(boolean b) Shows or hides this component depending on the value of parameter b . |
Dimension | size() Returns the size of this component in the form of a Dimension object. |
void | validate() Validates this container and all of its subcomponents. |