java.awt.Container (JDK 1.0)
This class implements a component that can contain other components. You cannot instantiate Container directly, but must use one of its subclasses, such as Panel, Frame, or Dialog. Once a Container is created, you may set its LayoutManager with setLayout(), add components to it with add(), and remove them with remove(). getComponents() returns an array of the components contained in a Container. locate() determines within which contained component a specified point falls. list() produces helpful debugging output.
public abstract classContainerextends Component { //Protected Constructor1.1 protectedContainer(); //Public Instance Methodspublic Componentadd(Componentcomp); public Componentadd(Stringname, Componentcomp); public Componentadd(Componentcomp, intindex); 1.1 public voidadd(Componentcomp, Objectconstraints); 1.1 public voidadd(Componentcomp, Objectconstraints, intindex); 1.1 public voidaddContainerListener(ContainerListenerl); public voidaddNotify(); //Overrides Component# public intcountComponents(); # public voiddeliverEvent(Evente); //Overrides Component1.1 public voiddoLayout(); //Overrides Component1.1 public floatgetAlignmentX(); //Overrides Component1.1 public floatgetAlignmentY(); //Overrides Componentpublic ComponentgetComponent(intn); 1.1 public ComponentgetComponentAt(intx, inty); //Overrides Component1.1 public ComponentgetComponentAt(Pointp); //Overrides Component1.1 public intgetComponentCount(); public Component[]getComponents(); 1.1 public InsetsgetInsets(); public LayoutManagergetLayout(); 1.1 public DimensiongetMaximumSize(); //Overrides Component1.1 public DimensiongetMinimumSize(); //Overrides Component1.1 public DimensiongetPreferredSize(); //Overrides Component# public Insetsinsets(); 1.1 public voidinvalidate(); //Overrides Component1.1 public booleanisAncestorOf(Componentc); # public voidlayout(); //Overrides Componentpublic voidlist(PrintStreamout, intindent); //Overrides Component1.1 public voidlist(PrintWriterout, intindent); //Overrides Component# public Componentlocate(intx, inty); //Overrides Component# public DimensionminimumSize(); //Overrides Component1.1 public voidpaint(Graphicsg); //Overrides Componentpublic voidpaintComponents(Graphicsg); # public DimensionpreferredSize(); //Overrides Component1.1 public voidg); //Overrides Componentpublic voidprintComponents(Graphicsg); 1.1 public voidremove(intindex); public voidremove(Componentcomp); public voidremoveAll(); 1.1 public voidremoveContainerListener(ContainerListenerl); public voidremoveNotify(); //Overrides Componentpublic voidsetLayout(LayoutManagermgr); public voidvalidate(); //Overrides Component//Protected Instance Methods1.1 protected voidaddImpl(Componentcomp, Objectconstraints, intindex); protected StringparamString(); //Overrides Component1.1 protected voidprocessContainerEvent(ContainerEvente); 1.1 protected voidprocessEvent(AWTEvente); //Overrides Component1.1 protected voidvalidateTree(); }
Hierarchy:
Object->Component(ImageObserver, MenuContainer, Serializable)->Container
Extended By:
Panel, ScrollPane, Window
Passed To:
BorderLayout.getLayoutAlignmentX(), BorderLayout.getLayoutAlignmentY(), BorderLayout.invalidateLayout(), BorderLayout.layoutContainer(), BorderLayout.maximumLayoutSize(), BorderLayout.minimumLayoutSize(), BorderLayout.preferredLayoutSize(), CardLayout.first(), CardLayout.getLayoutAlignmentX(), CardLayout.getLayoutAlignmentY(), CardLayout.invalidateLayout(), CardLayout.last(), CardLayout.layoutContainer(), CardLayout.maximumLayoutSize(), CardLayout.minimumLayoutSize(), CardLayout.next(), CardLayout.preferredLayoutSize(), CardLayout.previous(), CardLayout.show(), FlowLayout.layoutContainer(), FlowLayout.minimumLayoutSize(), FlowLayout.preferredLayoutSize(), GridBagLayout.ArrangeGrid(), GridBagLayout.getLayoutAlignmentX(), GridBagLayout.getLayoutAlignmentY(), GridBagLayout.GetLayoutInfo(), GridBagLayout.GetMinSize(), GridBagLayout.invalidateLayout(), GridBagLayout.layoutContainer(), GridBagLayout.maximumLayoutSize(), GridBagLayout.minimumLayoutSize(), GridBagLayout.preferredLayoutSize(), GridLayout.layoutContainer(), GridLayout.minimumLayoutSize(), GridLayout.preferredLayoutSize(), LayoutManager.layoutContainer(), LayoutManager.minimumLayoutSize(), LayoutManager.preferredLayoutSize(), LayoutManager2.getLayoutAlignmentX(), LayoutManager2.getLayoutAlignmentY(), LayoutManager2.invalidateLayout(), LayoutManager2.maximumLayoutSize()
Returned By:
Component.getParent(), ContainerEvent.getContainer(), Toolkit.getNativeContainer()