Java java.awt Container fields, constructors, methods, implement or subclass

Example usage for Java java.awt Container fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.awt Container.

The text is from its open source code.

Subclass

java.awt.Container has subclasses.
Click this link to see all its subclasses.

Constructor

Container()
Constructs a new Container.

Method

Componentadd(Component comp)
Appends the specified component to the end of this container.
Componentadd(String name, Component comp)
Adds the specified component to this container.
Componentadd(Component comp, int index)
Adds the specified component to this container at the given position.
voidadd(Component comp, Object constraints)
Adds the specified component to the end of this container.
voidadd(Component comp, Object constraints, int index)
Adds the specified component to this container with the specified constraints at the specified index.
voidaddContainerListener(ContainerListener l)
Adds the specified container listener to receive container events from this container.
voidaddFocusListener(FocusListener l)
Adds the specified focus listener to receive focus events from this component when this component gains input focus.
voidaddHierarchyBoundsListener(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.
voidaddKeyListener(KeyListener l)
Adds the specified key listener to receive key events from this component.
voidaddMouseWheelListener(MouseWheelListener l)
Adds the specified mouse wheel listener to receive mouse wheel events from this component.
voidaddNotify()
Makes this Container displayable by connecting it to a native screen resource.
voidaddPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list.
voidapplyComponentOrientation(ComponentOrientation o)
Sets the ComponentOrientation property of this container and all components contained within it.
intcountComponents()
Returns the number of components in this container.
booleandispatchEvent(AWTEvent e)
Dispatches an event to a sub-component if necessary, and returns whether or not the event was forwarded to a sub-component.
voiddoLayout()
Causes this container to lay out its components.
ColorgetBackground()
Gets the background color of this component.
RectanglegetBounds(Rectangle rv)
Stores the bounds of this component into "return value" rv and return rv.
RectanglegetBounds()
Gets the bounds of this component in the form of a Rectangle object.
ClassgetClass()
Returns the runtime class of this Object .
ComponentgetComponent(int n)
Gets the nth component in this container.
ComponentgetComponentAt(Point p)
Gets the component that contains the specified point.
intgetComponentCount()
Gets the number of components in this panel.
ComponentListener[]getComponentListeners()
Returns an array of all the component listeners registered on this component.
ComponentOrientationgetComponentOrientation()
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.
CursorgetCursor()
Gets the cursor set in the component.
ContainergetFocusCycleRootAncestor()
Returns the Container which is the focus cycle root of this Component's focus traversal cycle.
FocusTraversalPolicygetFocusTraversalPolicy()
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.
GraphicsConfigurationgetGraphicsConfiguration()
Gets the GraphicsConfiguration associated with this Component .
intgetHeight()
Returns the current height of this component.
InsetsgetInsets()
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.
LayoutManagergetLayout()
Gets the layout manager for this container.
PointgetLocationOnScreen()
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.
StringgetName()
Gets the name of the component.
ContainergetParent()
Gets the parent of this component.
DimensiongetPreferredSize()
Returns the preferred size of this container.
DimensiongetSize()
Returns the size of this component in the form of a Dimension object.
ObjectgetTreeLock()
Gets this component's locking object (the object that owns the thread synchronization monitor) for AWT component-tree and layout operations.
intgetWidth()
Returns the current width of this component.
intgetX()
Returns the current x coordinate of the components origin.
intgetY()
Returns the current y coordinate of the components origin.
Insetsinsets()
Returns the insets for this container.
voidinvalidate()
Invalidates the container.
booleanisAncestorOf(Component c)
Checks if the component is contained in the component hierarchy of this container.
booleanisDisplayable()
Determines whether this component is displayable.
booleanisEnabled()
Determines whether this component is enabled.
booleanisFocusable()
Returns whether this Component can be focused.
booleanisFocusCycleRoot()
Returns whether this Container is the root of a focus traversal cycle.
booleanisFocusTraversalPolicyProvider()
Returns whether this container provides focus traversal policy.
booleanisShowing()
Determines whether this component is showing on screen.
booleanisVisible()
Determines whether this component should be visible when its parent is visible.
voidpaintAll(Graphics g)
Paints this component and all of its subcomponents.
voidpaintComponents(Graphics g)
Paints each of the components in this container.
voidremove(int index)
Removes the component, specified by index , from this container.
voidremove(Component comp)
Removes the specified component from this container.
voidremoveAll()
Removes all the components from this container.
voidremoveComponentListener(ComponentListener l)
Removes the specified component listener so that it no longer receives component events from this component.
voidremoveContainerListener(ContainerListener l)
Removes the specified container listener so it no longer receives container events from this container.
voidremoveHierarchyBoundsListener(HierarchyBoundsListener l)
Removes the specified hierarchy bounds listener so that it no longer receives hierarchy bounds events from this component.
voidremoveKeyListener(KeyListener l)
Removes the specified key listener so that it no longer receives key events from this component.
voidremoveMouseListener(MouseListener l)
Removes the specified mouse listener so that it no longer receives mouse events from this component.
voidremoveMouseMotionListener(MouseMotionListener l)
Removes the specified mouse motion listener so that it no longer receives mouse motion events from this component.
voidremoveMouseWheelListener(MouseWheelListener l)
Removes the specified mouse wheel listener so that it no longer receives mouse wheel events from this component.
voidrepaint()
Repaints this component.
voidrevalidate()
Revalidates the component hierarchy up to the nearest validate root.
voidsetBackground(Color c)
Sets the background color of this component.
voidsetComponentOrientation(ComponentOrientation o)
Sets the language-sensitive orientation that is to be used to order the elements or text within this component.
voidsetCursor(Cursor cursor)
Sets the cursor image to the specified cursor.
voidsetEnabled(boolean b)
Enables or disables this component, depending on the value of the parameter b .
voidsetFocusCycleRoot(boolean focusCycleRoot)
Sets whether this Container is the root of a focus traversal cycle.
voidsetFocusTraversalKeys(int id, Set keystrokes)
Sets the focus traversal keys for a given traversal operation for this Container.
voidsetFont(Font f)
Sets the font of this container.
voidsetLayout(LayoutManager mgr)
Sets the layout manager for this container.
voidsetLocation(Point p)
Moves this component to a new location.
voidsetLocation(int x, int y)
Moves this component to a new location.
voidsetMaximumSize(Dimension maximumSize)
Sets the maximum size of this component to a constant value.
voidsetMinimumSize(Dimension minimumSize)
Sets the minimum size of this component to a constant value.
voidsetPreferredSize(Dimension preferredSize)
Sets the preferred size of this component to a constant value.
voidsetSize(int width, int height)
Resizes this component so that it has width width and height height .
voidsetSize(Dimension d)
Resizes this component so that it has width d.width and height d.height .
voidsetVisible(boolean b)
Shows or hides this component depending on the value of parameter b .
Dimensionsize()
Returns the size of this component in the form of a Dimension object.
voidvalidate()
Validates this container and all of its subcomponents.