Overview
Package
Class
Use
Tree
Deprecated
Index
All Classes
Help
Prev Class
Next Class
Sample
Document
Class java.awt.ScrollPane
Inherited members: ShowHide
Deprecated: ShowHide
View: ClientSubclassPackageImplementation
java.awt

Class ScrollPane

  • java.lang.Object
    • java.awt.Component
      • java.awt.Container
        • java.awt.ScrollPane
  • All Implemented Interfaces:
    java.awt.image.ImageObserver, MenuContainer, java.io.Serializable, javax.accessibility.Accessible
    public class ScrollPane extends Container implements javax.accessibility.Accessible
    A container class which implements automatic horizontal and/or vertical scrolling for a single child component. The display policy for the scrollbars can be set to:
    1. as needed: scrollbars created and shown only when needed by scrollpane
    2. always: scrollbars created and always shown by the scrollpane
    3. never: scrollbars never created or shown by the scrollpane

    The state of the horizontal and vertical scrollbars is represented by two ScrollPaneAdjustable objects (one for each dimension) which implement the Adjustable interface. The API provides methods to access those objects such that the attributes on the Adjustable object (such as unitIncrement, value, etc.) can be manipulated.

    Certain adjustable properties (minimum, maximum, blockIncrement, and visibleAmount) are set internally by the scrollpane in accordance with the geometry of the scrollpane and its child and these should not be set by programs using the scrollpane.

    If the scrollbar display policy is defined as "never", then the scrollpane can still be programmatically scrolled using the setScrollPosition() method and the scrollpane will move and clip the child's contents appropriately. This policy is useful if the program needs to create and manage its own adjustable controls.

    The placement of the scrollbars is controlled by platform-specific properties set by the user outside of the program.

    The initial size of this container is set to 100x100, but can be reset using setSize().

    Scrolling with the wheel on a wheel-equipped mouse is enabled by default. This can be disabled using setWheelScrollingEnabled. Wheel scrolling can be customized by setting the block and unit increment of the horizontal and vertical Adjustables. For information on how mouse wheel events are dispatched, see the class description for MouseWheelEvent.

    Insets are used to define any space used by scrollbars and any borders created by the scroll pane. getInsets() can be used to get the current value for the insets. If the value of scrollbarsAlwaysVisible is false, then the value of the insets will change dynamically depending on whether the scrollbars are currently visible or not.

    See Also:
    Serialized Form
    • Nested Classes 
      Modifier and Type Class and Description
      Inherited member indicator AccessibleAWTComponent Reveal DetailHide Detail
      protected class AccessibleAWTComponent
      Inner class of Component used to provide default support for accessibility.
      protected class AccessibleAWTComponent
      Inner class of Component used to provide default support for accessibility. This class is not meant to be used directly by application developers, but is instead meant only to be subclassed by component developers.

      The class used to obtain the accessible role for this object.

      Since:
      1.3
      See Also:
      Serialized Form
      Inherited member indicator BaselineResizeBehavior Reveal DetailHide Detail
      static class BaselineResizeBehavior
      Enumeration of the common ways the baseline of a component can change as the size changes.
      static class BaselineResizeBehavior
      Enumeration of the common ways the baseline of a component can change as the size changes. The baseline resize behavior is primarily for layout managers that need to know how the position of the baseline changes as the component size changes. In general the baseline resize behavior will be valid for sizes greater than or equal to the minimum size (the actual minimum size; not a developer specified minimum size). For sizes smaller than the minimum size the baseline may change in a way other than the baseline resize behavior indicates. Similarly, as the size approaches Integer.MAX_VALUE and/or Short.MAX_VALUE the baseline may change in a way other than the baseline resize behavior indicates.
      Since:
      1.6
      See Also:
      Component.getBaselineResizeBehavior(), Component.getBaseline(int,int)
      Inherited member indicator BltBufferStrategy Reveal DetailHide Detail
      protected class BltBufferStrategy
      Inner class for blitting offscreen surfaces to a component.
      protected class BltBufferStrategy
      Inner class for blitting offscreen surfaces to a component.
      Since:
      1.4
      Inherited member indicator FlipBufferStrategy Reveal DetailHide Detail
      protected class FlipBufferStrategy
      Inner class for flipping buffers on a component.
      protected class FlipBufferStrategy
      Inner class for flipping buffers on a component. That component must be a Canvas or Window.
      Since:
      1.4
      See Also:
      Canvas, Window, BufferStrategy
      Inherited member indicator AccessibleAWTContainer Reveal DetailHide Detail
      protected class AccessibleAWTContainer
      Inner class of Container used to provide default support for accessibility.
      protected class AccessibleAWTContainer
      Inner class of Container used to provide default support for accessibility. This class is not meant to be used directly by application developers, but is instead meant only to be subclassed by container developers.

      The class used to obtain the accessible role for this object, as well as implementing many of the methods in the AccessibleContainer interface.

      Since:
      1.3
      See Also:
      Serialized Form
      Ordinary member indicator AccessibleAWTScrollPane Reveal DetailHide Detail
      protected class AccessibleAWTScrollPane
      This class implements accessibility support for the ScrollPane class.
      protected class AccessibleAWTScrollPane
      This class implements accessibility support for the ScrollPane class. It provides an implementation of the Java Accessibility API appropriate to scroll pane user-interface elements.
      Since:
      1.3
      See Also:
      Serialized Form
    • Fields 
      Modifier and Type Field and Description
      Inherited member indicator ABORT Reveal DetailHide Detail
      static int ABORT
      This flag in the infoflags argument to imageUpdate indicates that an image which was being tracked asynchronously was aborted before production was complete.
      public static final int ABORT
      This flag in the infoflags argument to imageUpdate indicates that an image which was being tracked asynchronously was aborted before production was complete. No more information will become available without further action to trigger another image production sequence. If the ERROR flag was not also set in this image update, then accessing any of the data in the image will restart the production again, probably from the beginning.
      See Also:
      ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int), Constant Field Values
      Inherited member indicator ALLBITS Reveal DetailHide Detail
      static int ALLBITS
      This flag in the infoflags argument to imageUpdate indicates that a static image which was previously drawn is now complete and can be drawn again in its final form.
      public static final int ALLBITS
      This flag in the infoflags argument to imageUpdate indicates that a static image which was previously drawn is now complete and can be drawn again in its final form. The x, y, width, and height arguments to the imageUpdate callback method should be ignored.
      See Also:
      Graphics.drawImage(java.awt.Image, int, int, java.awt.image.ImageObserver), ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int), Constant Field Values
      Inherited member indicator BOTTOM_ALIGNMENT Reveal DetailHide Detail
      static float BOTTOM_ALIGNMENT
      Ease-of-use constant for getAlignmentY.
      public static final float BOTTOM_ALIGNMENT
      Ease-of-use constant for getAlignmentY. Specifies an alignment to the bottom of the component.
      See Also:
      Component.getAlignmentY(), Constant Field Values
      Inherited member indicator CENTER_ALIGNMENT Reveal DetailHide Detail
      static float CENTER_ALIGNMENT
      Ease-of-use constant for getAlignmentY and getAlignmentX.
      public static final float CENTER_ALIGNMENT
      Ease-of-use constant for getAlignmentY and getAlignmentX. Specifies an alignment to the center of the component
      See Also:
      Component.getAlignmentX(), Component.getAlignmentY(), Constant Field Values
      Inherited member indicator ERROR Reveal DetailHide Detail
      static int ERROR
      This flag in the infoflags argument to imageUpdate indicates that an image which was being tracked asynchronously has encountered an error.
      public static final int ERROR
      This flag in the infoflags argument to imageUpdate indicates that an image which was being tracked asynchronously has encountered an error. No further information will become available and drawing the image will fail. As a convenience, the ABORT flag will be indicated at the same time to indicate that the image production was aborted.
      See Also:
      ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int), Constant Field Values
      Inherited member indicator FRAMEBITS Reveal DetailHide Detail
      static int FRAMEBITS
      This flag in the infoflags argument to imageUpdate indicates that another complete frame of a multi-frame image which was previously drawn is now available to be drawn again.
      public static final int FRAMEBITS
      This flag in the infoflags argument to imageUpdate indicates that another complete frame of a multi-frame image which was previously drawn is now available to be drawn again. The x, y, width, and height arguments to the imageUpdate callback method should be ignored.
      See Also:
      Graphics.drawImage(java.awt.Image, int, int, java.awt.image.ImageObserver), ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int), Constant Field Values
      Inherited member indicator HEIGHT Reveal DetailHide Detail
      static int HEIGHT
      This flag in the infoflags argument to imageUpdate indicates that the height of the base image is now available and can be taken from the height argument to the imageUpdate callback method.
      public static final int HEIGHT
      This flag in the infoflags argument to imageUpdate indicates that the height of the base image is now available and can be taken from the height argument to the imageUpdate callback method.
      See Also:
      Image.getHeight(java.awt.image.ImageObserver), ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int), Constant Field Values
      Inherited member indicator LEFT_ALIGNMENT Reveal DetailHide Detail
      static float LEFT_ALIGNMENT
      Ease-of-use constant for getAlignmentX.
      public static final float LEFT_ALIGNMENT
      Ease-of-use constant for getAlignmentX. Specifies an alignment to the left side of the component.
      See Also:
      Component.getAlignmentX(), Constant Field Values
      Inherited member indicator PROPERTIES Reveal DetailHide Detail
      static int PROPERTIES
      This flag in the infoflags argument to imageUpdate indicates that the properties of the image are now available.
      public static final int PROPERTIES
      This flag in the infoflags argument to imageUpdate indicates that the properties of the image are now available.
      See Also:
      Image.getProperty(java.lang.String, java.awt.image.ImageObserver), ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int), Constant Field Values
      Inherited member indicator RIGHT_ALIGNMENT Reveal DetailHide Detail
      static float RIGHT_ALIGNMENT
      Ease-of-use constant for getAlignmentX.
      public static final float RIGHT_ALIGNMENT
      Ease-of-use constant for getAlignmentX. Specifies an alignment to the right side of the component.
      See Also:
      Component.getAlignmentX(), Constant Field Values
      Ordinary member indicator SCROLLBARS_ALWAYS Reveal DetailHide Detail
      static int SCROLLBARS_ALWAYS
      Specifies that horizontal/vertical scrollbars should always be shown regardless of the respective sizes of the scrollpane and child.
      public static final int SCROLLBARS_ALWAYS
      Specifies that horizontal/vertical scrollbars should always be shown regardless of the respective sizes of the scrollpane and child.
      See Also:
      Constant Field Values
      Ordinary member indicator SCROLLBARS_AS_NEEDED Reveal DetailHide Detail
      static int SCROLLBARS_AS_NEEDED
      Specifies that horizontal/vertical scrollbar should be shown only when the size of the child exceeds the size of the scrollpane in the horizontal/vertical dimension.
      public static final int SCROLLBARS_AS_NEEDED
      Specifies that horizontal/vertical scrollbar should be shown only when the size of the child exceeds the size of the scrollpane in the horizontal/vertical dimension.
      See Also:
      Constant Field Values
      Ordinary member indicator SCROLLBARS_NEVER Reveal DetailHide Detail
      static int SCROLLBARS_NEVER
      Specifies that horizontal/vertical scrollbars should never be shown regardless of the respective sizes of the scrollpane and child.
      public static final int SCROLLBARS_NEVER
      Specifies that horizontal/vertical scrollbars should never be shown regardless of the respective sizes of the scrollpane and child.
      See Also:
      Constant Field Values
      Inherited member indicator SOMEBITS Reveal DetailHide Detail
      static int SOMEBITS
      This flag in the infoflags argument to imageUpdate indicates that more pixels needed for drawing a scaled variation of the image are available.
      public static final int SOMEBITS
      This flag in the infoflags argument to imageUpdate indicates that more pixels needed for drawing a scaled variation of the image are available. The bounding box of the new pixels can be taken from the x, y, width, and height arguments to the imageUpdate callback method.
      See Also:
      Graphics.drawImage(java.awt.Image, int, int, java.awt.image.ImageObserver), ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int), Constant Field Values
      Inherited member indicator TOP_ALIGNMENT Reveal DetailHide Detail
      static float TOP_ALIGNMENT
      Ease-of-use constant for getAlignmentY().
      public static final float TOP_ALIGNMENT
      Ease-of-use constant for getAlignmentY(). Specifies an alignment to the top of the component.
      See Also:
      Component.getAlignmentY(), Constant Field Values
      Inherited member indicator WIDTH Reveal DetailHide Detail
      static int WIDTH
      This flag in the infoflags argument to imageUpdate indicates that the width of the base image is now available and can be taken from the width argument to the imageUpdate callback method.
      public static final int WIDTH
      This flag in the infoflags argument to imageUpdate indicates that the width of the base image is now available and can be taken from the width argument to the imageUpdate callback method.
      See Also:
      Image.getWidth(java.awt.image.ImageObserver), ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int), Constant Field Values
    • Constructors 
      Constructor and Description
      Ordinary member indicator ScrollPane Reveal DetailHide Detail
      ScrollPane()
      Create a new scrollpane container with a scrollbar display policy of "as needed".
      public ScrollPane() throws HeadlessException
      Create a new scrollpane container with a scrollbar display policy of "as needed".
      Throws:
      HeadlessException - if GraphicsEnvironment.isHeadless() returns true
      See Also:
      GraphicsEnvironment.isHeadless()
      Ordinary member indicator ScrollPane Reveal DetailHide Detail
      ScrollPane(int scrollbarDisplayPolicy)
      Create a new scrollpane container.
      @ConstructorProperties(value="scrollbarDisplayPolicy") public ScrollPane(int scrollbarDisplayPolicy) throws HeadlessException
      Create a new scrollpane container.
      Parameters:
      scrollbarDisplayPolicy - policy for when scrollbars should be shown
      Throws:
      java.lang.IllegalArgumentException - if the specified scrollbar display policy is invalid
      HeadlessException - if GraphicsEnvironment.isHeadless() returns true
      See Also:
      GraphicsEnvironment.isHeadless()
      • Basic Attribute Methods 
        Modifier and Type Method and Description
        Inherited member indicator applyComponentOrientation Reveal DetailHide Detail
        void applyComponentOrientation(ComponentOrientation o)
        Sets the ComponentOrientation property of this container and all components contained within it.
        public void applyComponentOrientation(ComponentOrientation o)
        Description copied from class: Container
        Sets the ComponentOrientation property of this container and all components contained within it.

        This method changes layout-related information, and therefore, invalidates the component hierarchy.

        Overrides:
        applyComponentOrientation in class Component
        Parameters:
        o - the new component orientation of this container and the components contained within it.
        Throws:
        java.lang.NullPointerException - if orientation is null.
        Since:
        1.4
        See Also:
        Component.setComponentOrientation(java.awt.ComponentOrientation), Component.getComponentOrientation(), Container.invalidate()
        Inherited member indicator disable Reveal DetailHide Detail
        void disable()
        Deprecated. As of JDK version 1.1, replaced by setEnabled(boolean).
        @Deprecated public void disable()
        Deprecated. As of JDK version 1.1, replaced by setEnabled(boolean).
        Inherited member indicator enable Reveal DetailHide Detail
        void enable()
        Deprecated. As of JDK version 1.1, replaced by setEnabled(boolean).
        @Deprecated public void enable()
        Deprecated. As of JDK version 1.1, replaced by setEnabled(boolean).
        Inherited member indicator enable Reveal DetailHide Detail
        void enable(boolean b)
        Deprecated. As of JDK version 1.1, replaced by setEnabled(boolean).
        @Deprecated public void enable(boolean b)
        Deprecated. As of JDK version 1.1, replaced by setEnabled(boolean).
        Inherited member indicator enableInputMethods Reveal DetailHide Detail
        void enableInputMethods(boolean enable)
        Enables or disables input method support for this component.
        public void enableInputMethods(boolean enable)
        Description copied from class: Component
        Enables or disables input method support for this component. If input method support is enabled and the component also processes key events, incoming events are offered to the current input method and will only be processed by the component or dispatched to its listeners if the input method does not consume them. By default, input method support is enabled.
        Parameters:
        enable - true to enable, false to disable
        Since:
        1.2
        See Also:
        Component.processKeyEvent(java.awt.event.KeyEvent)
        Overridden member indicator getAccessibleContext Reveal DetailHide Detail
        javax.accessibility.AccessibleContext getAccessibleContext()
        Gets the AccessibleContext associated with this ScrollPane.
        public javax.accessibility.AccessibleContext getAccessibleContext()
        Gets the AccessibleContext associated with this ScrollPane. For scroll panes, the AccessibleContext takes the form of an AccessibleAWTScrollPane. A new AccessibleAWTScrollPane instance is created if necessary.
        Specified by:
        getAccessibleContext in interface javax.accessibility.Accessible
        Overrides:
        getAccessibleContext in class Component
        Returns:
        an AccessibleAWTScrollPane that serves as the AccessibleContext of this ScrollPane
        Since:
        1.3
        Inherited member indicator getBackground Reveal DetailHide Detail
        Color getBackground()
        Gets the background color of this component.
        public Color getBackground()
        Description copied from class: Component
        Gets the background color of this component.
        Returns:
        this component's background color; if this component does not have a background color, the background color of its parent is returned
        Since:
        JDK1.0
        See Also:
        Component.setBackground(java.awt.Color)
        Inherited member indicator getColorModel Reveal DetailHide Detail
        java.awt.image.ColorModel getColorModel()
        Gets the instance of ColorModel used to display the component on the output device.
        public java.awt.image.ColorModel getColorModel()
        Description copied from class: Component
        Gets the instance of ColorModel used to display the component on the output device.
        Returns:
        the color model used by this component
        Since:
        JDK1.0
        See Also:
        ColorModel, ComponentPeer.getColorModel(), Toolkit.getColorModel()
        Inherited member indicator getComponentOrientation Reveal DetailHide Detail
        ComponentOrientation getComponentOrientation()
        Retrieves the language-sensitive orientation that is to be used to order the elements or text within this component.
        public ComponentOrientation getComponentOrientation()
        Description copied from class: Component
        Retrieves the language-sensitive orientation that is to be used to order the elements or text within this component. LayoutManager and Component subclasses that wish to respect orientation should call this method to get the component's orientation before performing layout or drawing.
        See Also:
        ComponentOrientation
        Inherited member indicator getCursor Reveal DetailHide Detail
        Cursor getCursor()
        Gets the cursor set in the component.
        public Cursor getCursor()
        Description copied from class: Component
        Gets the cursor set in the component. If the component does not have a cursor set, the cursor of its parent is returned. If no cursor is set in the entire hierarchy, Cursor.DEFAULT_CURSOR is returned.
        Since:
        JDK1.1
        See Also:
        Component.setCursor(java.awt.Cursor)
        Inherited member indicator getFont Reveal DetailHide Detail
        Font getFont()
        Gets the font of this component.
        public Font getFont()
        Description copied from class: Component
        Gets the font of this component.
        Specified by:
        getFont in interface MenuContainer
        Returns:
        this component's font; if a font has not been set for this component, the font of its parent is returned
        Since:
        JDK1.0
        See Also:
        Component.setFont(java.awt.Font)
        Inherited member indicator getForeground Reveal DetailHide Detail
        Color getForeground()
        Gets the foreground color of this component.
        public Color getForeground()
        Description copied from class: Component
        Gets the foreground color of this component.
        Returns:
        this component's foreground color; if this component does not have a foreground color, the foreground color of its parent is returned
        Since:
        JDK1.0
        See Also:
        Component.setForeground(java.awt.Color)
        Inherited member indicator getLocale Reveal DetailHide Detail
        java.util.Locale getLocale()
        Gets the locale of this component.
        public java.util.Locale getLocale()
        Description copied from class: Component
        Gets the locale of this component.
        Returns:
        this component's locale; if this component does not have a locale, the locale of its parent is returned
        Throws:
        IllegalComponentStateException - if the Component does not have its own locale and has not yet been added to a containment hierarchy such that the locale can be determined from the containing parent
        Since:
        JDK1.1
        See Also:
        Component.setLocale(java.util.Locale)
        Inherited member indicator getName Reveal DetailHide Detail
        java.lang.String getName()
        Gets the name of the component.
        public java.lang.String getName()
        Description copied from class: Component
        Gets the name of the component.
        Returns:
        this component's name
        Since:
        JDK1.1
        See Also:
        Component.setName(java.lang.String)
        Inherited member indicator getParent Reveal DetailHide Detail
        Container getParent()
        Gets the parent of this component.
        public Container getParent()
        Description copied from class: Component
        Gets the parent of this component.
        Returns:
        the parent container of this component
        Since:
        JDK1.0
        Inherited member indicator hide Reveal DetailHide Detail
        void hide()
        Deprecated. As of JDK version 1.1, replaced by setVisible(boolean).
        @Deprecated public void hide()
        Deprecated. As of JDK version 1.1, replaced by setVisible(boolean).
        Inherited member indicator isBackgroundSet Reveal DetailHide Detail
        boolean isBackgroundSet()
        Returns whether the background color has been explicitly set for this Component.
        public boolean isBackgroundSet()
        Description copied from class: Component
        Returns whether the background color has been explicitly set for this Component. If this method returns false, this Component is inheriting its background color from an ancestor.
        Returns:
        true if the background color has been explicitly set for this Component; false otherwise.
        Since:
        1.4
        Inherited member indicator isCursorSet Reveal DetailHide Detail
        boolean isCursorSet()
        Returns whether the cursor has been explicitly set for this Component.
        public boolean isCursorSet()
        Description copied from class: Component
        Returns whether the cursor has been explicitly set for this Component. If this method returns false, this Component is inheriting its cursor from an ancestor.
        Returns:
        true if the cursor has been explicitly set for this Component; false otherwise.
        Since:
        1.4
        Inherited member indicator isDisplayable Reveal DetailHide Detail
        boolean isDisplayable()
        Determines whether this component is displayable.
        public boolean isDisplayable()
        Description copied from class: Component
        Determines whether this component is displayable. A component is displayable when it is connected to a native screen resource.

        A component is made displayable either when it is added to a displayable containment hierarchy or when its containment hierarchy is made displayable. A containment hierarchy is made displayable when its ancestor window is either packed or made visible.

        A component is made undisplayable either when it is removed from a displayable containment hierarchy or when its containment hierarchy is made undisplayable. A containment hierarchy is made undisplayable when its ancestor window is disposed.

        Returns:
        true if the component is displayable, false otherwise
        Since:
        1.2
        See Also:
        Container.add(Component), Window.pack(), Window.show(), Container.remove(Component), Window.dispose()
        Inherited member indicator isDoubleBuffered Reveal DetailHide Detail
        boolean isDoubleBuffered()
        Returns true if this component is painted to an offscreen image ("buffer") that's copied to the screen later.
        public boolean isDoubleBuffered()
        Description copied from class: Component
        Returns true if this component is painted to an offscreen image ("buffer") that's copied to the screen later. Component subclasses that support double buffering should override this method to return true if double buffering is enabled.
        Returns:
        false by default
        Inherited member indicator isEnabled Reveal DetailHide Detail
        boolean isEnabled()
        Determines whether this component is enabled.
        public boolean isEnabled()
        Description copied from class: Component
        Determines whether this component is enabled. An enabled component can respond to user input and generate events. Components are enabled initially by default. A component may be enabled or disabled by calling its setEnabled method.
        Returns:
        true if the component is enabled, false otherwise
        Since:
        JDK1.0
        See Also:
        Component.setEnabled(boolean)
        Inherited member indicator isFontSet Reveal DetailHide Detail
        boolean isFontSet()
        Returns whether the font has been explicitly set for this Component.
        public boolean isFontSet()
        Description copied from class: Component
        Returns whether the font has been explicitly set for this Component. If this method returns false, this Component is inheriting its font from an ancestor.
        Returns:
        true if the font has been explicitly set for this Component; false otherwise.
        Since:
        1.4
        Inherited member indicator isForegroundSet Reveal DetailHide Detail
        boolean isForegroundSet()
        Returns whether the foreground color has been explicitly set for this Component.
        public boolean isForegroundSet()
        Description copied from class: Component
        Returns whether the foreground color has been explicitly set for this Component. If this method returns false, this Component is inheriting its foreground color from an ancestor.
        Returns:
        true if the foreground color has been explicitly set for this Component; false otherwise.
        Since:
        1.4
        Inherited member indicator isLightweight Reveal DetailHide Detail
        boolean isLightweight()
        A lightweight component doesn't have a native toolkit peer.
        public boolean isLightweight()
        Description copied from class: Component
        A lightweight component doesn't have a native toolkit peer. Subclasses of Component and Container, other than the ones defined in this package like Button or Scrollbar, are lightweight. All of the Swing components are lightweights.

        This method will always return false if this component is not displayable because it is impossible to determine the weight of an undisplayable component.

        Returns:
        true if this component has a lightweight peer; false if it has a native peer or no peer
        Since:
        1.2
        See Also:
        Component.isDisplayable()
        Inherited member indicator isOpaque Reveal DetailHide Detail
        boolean isOpaque()
        Returns true if this component is completely opaque, returns false by default.
        public boolean isOpaque()
        Description copied from class: Component
        Returns true if this component is completely opaque, returns false by default.

        An opaque component paints every pixel within its rectangular region. A non-opaque component paints only some of its pixels, allowing the pixels underneath it to "show through". A component that does not fully paint its pixels therefore provides a degree of transparency.

        Subclasses that guarantee to always completely paint their contents should override this method and return true.

        Returns:
        true if this component is completely opaque
        Since:
        1.2
        See Also:
        Component.isLightweight()
        Inherited member indicator isShowing Reveal DetailHide Detail
        boolean isShowing()
        Determines whether this component is showing on screen.
        public boolean isShowing()
        Description copied from class: Component
        Determines whether this component is showing on screen. This means that the component must be visible, and it must be in a container that is visible and showing.

        Note: sometimes there is no way to detect whether the Component is actually visible to the user. This can happen when:

        • the component has been added to a visible ScrollPane but the Component is not currently in the scroll pane's view port.
        • the Component is obscured by another Component or Container.
        Returns:
        true if the component is showing, false otherwise
        Since:
        JDK1.0
        See Also:
        Component.setVisible(boolean)
        Inherited member indicator isVisible Reveal DetailHide Detail
        boolean isVisible()
        Determines whether this component should be visible when its parent is visible.
        public boolean isVisible()
        Description copied from class: Component
        Determines whether this component should be visible when its parent is visible. Components are initially visible, with the exception of top level components such as Frame objects.
        Returns:
        true if the component is visible, false otherwise
        Since:
        JDK1.0
        See Also:
        Component.setVisible(boolean)
        Inherited member indicator setBackground Reveal DetailHide Detail
        void setBackground(Color c)
        Sets the background color of this component.
        public void setBackground(Color c)
        Description copied from class: Component
        Sets the background color of this component.

        The background color affects each component differently and the parts of the component that are affected by the background color may differ between operating systems.

        Parameters:
        c - the color to become this component's color; if this parameter is null, then this component will inherit the background color of its parent
        Since:
        JDK1.0
        See Also:
        Component.getBackground()
        Inherited member indicator setComponentOrientation Reveal DetailHide Detail
        void setComponentOrientation(ComponentOrientation o)
        Sets the language-sensitive orientation that is to be used to order the elements or text within this component.
        public void setComponentOrientation(ComponentOrientation o)
        Description copied from class: Component
        Sets the language-sensitive orientation that is to be used to order the elements or text within this component. Language-sensitive LayoutManager and Component subclasses will use this property to determine how to lay out and draw components.

        At construction time, a component's orientation is set to ComponentOrientation.UNKNOWN, indicating that it has not been specified explicitly. The UNKNOWN orientation behaves the same as ComponentOrientation.LEFT_TO_RIGHT.

        To set the orientation of a single component, use this method. To set the orientation of an entire component hierarchy, use applyComponentOrientation.

        This method changes layout-related information, and therefore, invalidates the component hierarchy.

        See Also:
        ComponentOrientation, Component.invalidate()
        Inherited member indicator setCursor Reveal DetailHide Detail
        void setCursor(Cursor cursor)
        Sets the cursor image to the specified cursor.
        public void setCursor(Cursor cursor)
        Description copied from class: Component
        Sets the cursor image to the specified cursor. This cursor image is displayed when the contains method for this component returns true for the current cursor location, and this Component is visible, displayable, and enabled. Setting the cursor of a Container causes that cursor to be displayed within all of the container's subcomponents, except for those that have a non-null cursor.

        The method may have no visual effect if the Java platform implementation and/or the native system do not support changing the mouse cursor shape.

        Parameters:
        cursor - One of the constants defined by the Cursor class; if this parameter is null then this component will inherit the cursor of its parent
        Since:
        JDK1.1
        See Also:
        Component.isEnabled(), Component.isShowing(), Component.getCursor(), Component.contains(int, int), Toolkit.createCustomCursor(java.awt.Image, java.awt.Point, java.lang.String), Cursor
        Inherited member indicator setEnabled Reveal DetailHide Detail
        void setEnabled(boolean b)
        Enables or disables this component, depending on the value of the parameter b.
        public void setEnabled(boolean b)
        Description copied from class: Component
        Enables or disables this component, depending on the value of the parameter b. An enabled component can respond to user input and generate events. Components are enabled initially by default.

        Note: Disabling a lightweight component does not prevent it from receiving MouseEvents.

        Note: Disabling a heavyweight container prevents all components in this container from receiving any input events. But disabling a lightweight container affects only this container.

        Parameters:
        b - If true, this component is enabled; otherwise this component is disabled
        Since:
        JDK1.1
        See Also:
        Component.isEnabled(), Component.isLightweight()
        Inherited member indicator setFont Reveal DetailHide Detail
        void setFont(Font f)
        Sets the font of this container.
        public void setFont(Font f)
        Description copied from class: Container
        Sets the font of this container.

        This method changes layout-related information, and therefore, invalidates the component hierarchy.

        Overrides:
        setFont in class Component
        Parameters:
        f - The font to become this container's font.
        Since:
        JDK1.0
        See Also:
        Component.getFont(), Container.invalidate()
        Inherited member indicator setForeground Reveal DetailHide Detail
        void setForeground(Color c)
        Sets the foreground color of this component.
        public void setForeground(Color c)
        Description copied from class: Component
        Sets the foreground color of this component.
        Parameters:
        c - the color to become this component's foreground color; if this parameter is null then this component will inherit the foreground color of its parent
        Since:
        JDK1.0
        See Also:
        Component.getForeground()
        Inherited member indicator setLocale Reveal DetailHide Detail
        void setLocale(java.util.Locale l)
        Sets the locale of this component.
        public void setLocale(java.util.Locale l)
        Description copied from class: Component
        Sets the locale of this component. This is a bound property.

        This method changes layout-related information, and therefore, invalidates the component hierarchy.

        Parameters:
        l - the locale to become this component's locale
        Since:
        JDK1.1
        See Also:
        Component.getLocale(), Component.invalidate()
        Inherited member indicator setName Reveal DetailHide Detail
        void setName(java.lang.String name)
        Sets the name of the component to the specified string.
        public void setName(java.lang.String name)
        Description copied from class: Component
        Sets the name of the component to the specified string.
        Parameters:
        name - the string that is to be this component's name
        Since:
        JDK1.1
        See Also:
        Component.getName()
        Inherited member indicator setVisible Reveal DetailHide Detail
        void setVisible(boolean b)
        Shows or hides this component depending on the value of parameter b.
        public void setVisible(boolean b)
        Description copied from class: Component
        Shows or hides this component depending on the value of parameter b.

        This method changes layout-related information, and therefore, invalidates the component hierarchy.

        Parameters:
        b - if true, shows this component; otherwise, hides this component
        Since:
        JDK1.1
        See Also:
        Component.isVisible(), Component.invalidate()
        Inherited member indicator show Reveal DetailHide Detail
        void show()
        Deprecated. As of JDK version 1.1, replaced by setVisible(boolean).
        @Deprecated public void show()
        Deprecated. As of JDK version 1.1, replaced by setVisible(boolean).
        Inherited member indicator show Reveal DetailHide Detail
        void show(boolean b)
        Deprecated. As of JDK version 1.1, replaced by setVisible(boolean).
        @Deprecated public void show(boolean b)
        Deprecated. As of JDK version 1.1, replaced by setVisible(boolean).
      • Event Support Methods 
        Modifier and Type Method and Description
        Inherited member indicator action Reveal DetailHide Detail
        boolean action(Event evt, java.lang.Object what)
        Deprecated. As of JDK version 1.1, should register this component as ActionListener on component which fires action events.
        @Deprecated public boolean action(Event evt, java.lang.Object what)
        Deprecated. As of JDK version 1.1, should register this component as ActionListener on component which fires action events.
        Inherited member indicator coalesceEvents Reveal DetailHide Detail
        protected AWTEvent coalesceEvents(AWTEvent existingEvent, AWTEvent newEvent)
        Potentially coalesce an event being posted with an existing event.
        protected AWTEvent coalesceEvents(AWTEvent existingEvent, AWTEvent newEvent)
        Description copied from class: Component
        Potentially coalesce an event being posted with an existing event. This method is called by EventQueue.postEvent if an event with the same ID as the event to be posted is found in the queue (both events must have this component as their source). This method either returns a coalesced event which replaces the existing event (and the new event is then discarded), or null to indicate that no combining should be done (add the second event to the end of the queue). Either event parameter may be modified and returned, as the other one is discarded unless null is returned.

        This implementation of coalesceEvents coalesces two event types: mouse move (and drag) events, and paint (and update) events. For mouse move events the last event is always returned, causing intermediate moves to be discarded. For paint events, the new event is coalesced into a complex RepaintArea in the peer. The new AWTEvent is always returned.

        Parameters:
        existingEvent - the event already on the EventQueue
        newEvent - the event being posted to the EventQueue
        Returns:
        a coalesced event, or null indicating that no coalescing was done
        Inherited member indicator deliverEvent Reveal DetailHide Detail
        void deliverEvent(Event e)
        Deprecated. As of JDK version 1.1, replaced by dispatchEvent(AWTEvent e)
        @Deprecated public void deliverEvent(Event e)
        Deprecated. As of JDK version 1.1, replaced by dispatchEvent(AWTEvent e)
        Inherited member indicator disableEvents Reveal DetailHide Detail
        protected void disableEvents(long eventsToDisable)
        Disables the events defined by the specified event mask parameter from being delivered to this component.
        protected final void disableEvents(long eventsToDisable)
        Description copied from class: Component
        Disables the events defined by the specified event mask parameter from being delivered to this component.
        Parameters:
        eventsToDisable - the event mask defining the event types
        Since:
        JDK1.1
        See Also:
        Component.enableEvents(long)
        Inherited member indicator dispatchEvent Reveal DetailHide Detail
        void dispatchEvent(AWTEvent e)
        Dispatches an event to this component or one of its sub components.
        public final void dispatchEvent(AWTEvent e)
        Description copied from class: Component
        Dispatches an event to this component or one of its sub components. Calls processEvent before returning for 1.1-style events which have been enabled for the Component.
        Parameters:
        e - the event
        Inherited member indicator enableEvents Reveal DetailHide Detail
        protected void enableEvents(long eventsToEnable)
        Enables the events defined by the specified event mask parameter to be delivered to this component.
        protected final void enableEvents(long eventsToEnable)
        Description copied from class: Component
        Enables the events defined by the specified event mask parameter to be delivered to this component.

        Event types are automatically enabled when a listener for that event type is added to the component.

        This method only needs to be invoked by subclasses of Component which desire to have the specified event types delivered to processEvent regardless of whether or not a listener is registered.

        Parameters:
        eventsToEnable - the event mask defining the event types
        Since:
        JDK1.1
        See Also:
        Component.processEvent(java.awt.AWTEvent), Component.disableEvents(long), AWTEvent
        Inherited member indicator firePropertyChange Reveal DetailHide Detail
        protected void firePropertyChange(java.lang.String propertyName, boolean oldValue, boolean newValue)
        Support for reporting bound property changes for boolean properties.
        protected void firePropertyChange(java.lang.String propertyName, boolean oldValue, boolean newValue)
        Description copied from class: Component
        Support for reporting bound property changes for boolean properties. This method can be called when a bound property has changed and it will send the appropriate PropertyChangeEvent to any registered PropertyChangeListeners.
        Parameters:
        propertyName - the property whose value has changed
        oldValue - the property's previous value
        newValue - the property's new value
        Since:
        1.4
        Inherited member indicator firePropertyChange Reveal DetailHide Detail
        void firePropertyChange(java.lang.String propertyName, byte oldValue, byte newValue)
        Reports a bound property change.
        public void firePropertyChange(java.lang.String propertyName, byte oldValue, byte newValue)
        Description copied from class: Component
        Reports a bound property change.
        Parameters:
        propertyName - the programmatic name of the property that was changed
        oldValue - the old value of the property (as a byte)
        newValue - the new value of the property (as a byte)
        Since:
        1.5
        See Also:
        Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object)
        Inherited member indicator firePropertyChange Reveal DetailHide Detail
        void firePropertyChange(java.lang.String propertyName, char oldValue, char newValue)
        Reports a bound property change.
        public void firePropertyChange(java.lang.String propertyName, char oldValue, char newValue)
        Description copied from class: Component
        Reports a bound property change.
        Parameters:
        propertyName - the programmatic name of the property that was changed
        oldValue - the old value of the property (as a char)
        newValue - the new value of the property (as a char)
        Since:
        1.5
        See Also:
        Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object)
        Inherited member indicator firePropertyChange Reveal DetailHide Detail
        void firePropertyChange(java.lang.String propertyName, double oldValue, double newValue)
        Reports a bound property change.
        public void firePropertyChange(java.lang.String propertyName, double oldValue, double newValue)
        Description copied from class: Component
        Reports a bound property change.
        Parameters:
        propertyName - the programmatic name of the property that was changed
        oldValue - the old value of the property (as a double)
        newValue - the new value of the property (as a double)
        Since:
        1.5
        See Also:
        Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object)
        Inherited member indicator firePropertyChange Reveal DetailHide Detail
        void firePropertyChange(java.lang.String propertyName, float oldValue, float newValue)
        Reports a bound property change.
        public void firePropertyChange(java.lang.String propertyName, float oldValue, float newValue)
        Description copied from class: Component
        Reports a bound property change.
        Parameters:
        propertyName - the programmatic name of the property that was changed
        oldValue - the old value of the property (as a float)
        newValue - the new value of the property (as a float)
        Since:
        1.5
        See Also:
        Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object)
        Inherited member indicator firePropertyChange Reveal DetailHide Detail
        protected void firePropertyChange(java.lang.String propertyName, int oldValue, int newValue)
        Support for reporting bound property changes for integer properties.
        protected void firePropertyChange(java.lang.String propertyName, int oldValue, int newValue)
        Description copied from class: Component
        Support for reporting bound property changes for integer properties. This method can be called when a bound property has changed and it will send the appropriate PropertyChangeEvent to any registered PropertyChangeListeners.
        Parameters:
        propertyName - the property whose value has changed
        oldValue - the property's previous value
        newValue - the property's new value
        Since:
        1.4
        Inherited member indicator firePropertyChange Reveal DetailHide Detail
        void firePropertyChange(java.lang.String propertyName, long oldValue, long newValue)
        Reports a bound property change.
        public void firePropertyChange(java.lang.String propertyName, long oldValue, long newValue)
        Description copied from class: Component
        Reports a bound property change.
        Parameters:
        propertyName - the programmatic name of the property that was changed
        oldValue - the old value of the property (as a long)
        newValue - the new value of the property (as a long)
        Since:
        1.5
        See Also:
        Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object)
        Inherited member indicator firePropertyChange Reveal DetailHide Detail
        protected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
        Support for reporting bound property changes for Object properties.
        protected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
        Description copied from class: Component
        Support for reporting bound property changes for Object properties. This method can be called when a bound property has changed and it will send the appropriate PropertyChangeEvent to any registered PropertyChangeListeners.
        Parameters:
        propertyName - the property whose value has changed
        oldValue - the property's previous value
        newValue - the property's new value
        Inherited member indicator firePropertyChange Reveal DetailHide Detail
        void firePropertyChange(java.lang.String propertyName, short oldValue, short newValue)
        Reports a bound property change.
        public void firePropertyChange(java.lang.String propertyName, short oldValue, short newValue)
        Description copied from class: Component
        Reports a bound property change.
        Parameters:
        propertyName - the programmatic name of the property that was changed
        oldValue - the old value of the property (as a short)
        newValue - the old value of the property (as a short)
        Since:
        1.5
        See Also:
        Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object)
        Inherited member indicator getListeners Reveal DetailHide Detail
        <T extends java.util.EventListener> T[] getListeners(java.lang.Class<T> listenerType)
        Returns an array of all the objects currently registered as FooListeners upon this Container.
        public <T extends java.util.EventListener> T[] getListeners(java.lang.Class<T> listenerType)
        Description copied from class: Container
        Returns an array of all the objects currently registered as FooListeners upon this Container. FooListeners are registered using the addFooListener method.

        You can specify the listenerType argument with a class literal, such as FooListener.class. For example, you can query a Container c for its container listeners with the following code:

        ContainerListener[] cls = (ContainerListener[])(c.getListeners(ContainerListener.class));
        If no such listeners exist, this method returns an empty array.
        Overrides:
        getListeners in class Component
        Parameters:
        listenerType - the type of listeners requested; this parameter should specify an interface that descends from java.util.EventListener
        Returns:
        an array of all objects registered as FooListeners on this container, or an empty array if no such listeners have been added
        Throws:
        java.lang.ClassCastException - if listenerType doesn't specify a class or interface that implements java.util.EventListener
        java.lang.NullPointerException - if listenerType is null
        Since:
        1.3
        See Also:
        Container.getContainerListeners()
        Inherited member indicator handleEvent Reveal DetailHide Detail
        boolean handleEvent(Event evt)
        Deprecated. As of JDK version 1.1 replaced by processEvent(AWTEvent).
        @Deprecated public boolean handleEvent(Event evt)
        Deprecated. As of JDK version 1.1 replaced by processEvent(AWTEvent).
        Inherited member indicator keyDown Reveal DetailHide Detail
        boolean keyDown(Event evt, int key)
        Deprecated. As of JDK version 1.1, replaced by processKeyEvent(KeyEvent).
        @Deprecated public boolean keyDown(Event evt, int key)
        Deprecated. As of JDK version 1.1, replaced by processKeyEvent(KeyEvent).
        Inherited member indicator keyUp Reveal DetailHide Detail
        boolean keyUp(Event evt, int key)
        Deprecated. As of JDK version 1.1, replaced by processKeyEvent(KeyEvent).
        @Deprecated public boolean keyUp(Event evt, int key)
        Deprecated. As of JDK version 1.1, replaced by processKeyEvent(KeyEvent).
        Inherited member indicator mouseDown Reveal DetailHide Detail
        boolean mouseDown(Event evt, int x, int y)
        Deprecated. As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).
        @Deprecated public boolean mouseDown(Event evt, int x, int y)
        Deprecated. As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).
        Inherited member indicator mouseDrag Reveal DetailHide Detail
        boolean mouseDrag(Event evt, int x, int y)
        Deprecated. As of JDK version 1.1, replaced by processMouseMotionEvent(MouseEvent).
        @Deprecated public boolean mouseDrag(Event evt, int x, int y)
        Deprecated. As of JDK version 1.1, replaced by processMouseMotionEvent(MouseEvent).
        Inherited member indicator mouseEnter Reveal DetailHide Detail
        boolean mouseEnter(Event evt, int x, int y)
        Deprecated. As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).
        @Deprecated public boolean mouseEnter(Event evt, int x, int y)
        Deprecated. As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).
        Inherited member indicator mouseExit Reveal DetailHide Detail
        boolean mouseExit(Event evt, int x, int y)
        Deprecated. As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).
        @Deprecated public boolean mouseExit(Event evt, int x, int y)
        Deprecated. As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).
        Inherited member indicator mouseMove Reveal DetailHide Detail
        boolean mouseMove(Event evt, int x, int y)
        Deprecated. As of JDK version 1.1, replaced by processMouseMotionEvent(MouseEvent).
        @Deprecated public boolean mouseMove(Event evt, int x, int y)
        Deprecated. As of JDK version 1.1, replaced by processMouseMotionEvent(MouseEvent).
        Inherited member indicator mouseUp Reveal DetailHide Detail
        boolean mouseUp(Event evt, int x, int y)
        Deprecated. As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).
        @Deprecated public boolean mouseUp(Event evt, int x, int y)
        Deprecated. As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).
        Inherited member indicator postEvent Reveal DetailHide Detail
        boolean postEvent(Event e)
        Deprecated. As of JDK version 1.1, replaced by dispatchEvent(AWTEvent).
        @Deprecated public boolean postEvent(Event e)
        Deprecated. As of JDK version 1.1, replaced by dispatchEvent(AWTEvent).
        Inherited member indicator processComponentEvent Reveal DetailHide Detail
        protected void processComponentEvent(ComponentEvent e)
        Processes component events occurring on this component by dispatching them to any registered ComponentListener objects.
        protected void processComponentEvent(ComponentEvent e)
        Description copied from class: Component
        Processes component events occurring on this component by dispatching them to any registered ComponentListener objects.

        This method is not called unless component events are enabled for this component. Component events are enabled when one of the following occurs:

        • A ComponentListener object is registered via addComponentListener.
        • Component events are enabled via enableEvents.

        Note that if the event parameter is null the behavior is unspecified and may result in an exception.

        Parameters:
        e - the component event
        Since:
        JDK1.1
        See Also:
        ComponentEvent, ComponentListener, Component.addComponentListener(java.awt.event.ComponentListener), Component.enableEvents(long)
        Inherited member indicator processContainerEvent Reveal DetailHide Detail
        protected void processContainerEvent(ContainerEvent e)
        Processes container events occurring on this container by dispatching them to any registered ContainerListener objects.
        protected void processContainerEvent(ContainerEvent e)
        Description copied from class: Container
        Processes container events occurring on this container by dispatching them to any registered ContainerListener objects. NOTE: This method will not be called unless container events are enabled for this component; this happens when one of the following occurs:
        • A ContainerListener object is registered via addContainerListener
        • Container events are enabled via enableEvents

        Note that if the event parameter is null the behavior is unspecified and may result in an exception.

        Parameters:
        e - the container event
        See Also:
        Component.enableEvents(long)
        Inherited member indicator processEvent Reveal DetailHide Detail
        protected void processEvent(AWTEvent e)
        Processes events on this container.
        protected void processEvent(AWTEvent e)
        Description copied from class: Container
        Processes events on this container. If the event is a ContainerEvent, it invokes the processContainerEvent method, else it invokes its superclass's processEvent.

        Note that if the event parameter is null the behavior is unspecified and may result in an exception.

        Overrides:
        processEvent in class Component
        Parameters:
        e - the event
        See Also:
        Component.processComponentEvent(java.awt.event.ComponentEvent), Component.processFocusEvent(java.awt.event.FocusEvent), Component.processKeyEvent(java.awt.event.KeyEvent), Component.processMouseEvent(java.awt.event.MouseEvent), Component.processMouseMotionEvent(java.awt.event.MouseEvent), Component.processInputMethodEvent(java.awt.event.InputMethodEvent), Component.processHierarchyEvent(java.awt.event.HierarchyEvent), Component.processMouseWheelEvent(java.awt.event.MouseWheelEvent)
        Inherited member indicator processFocusEvent Reveal DetailHide Detail
        protected void processFocusEvent(FocusEvent e)
        Processes focus events occurring on this component by dispatching them to any registered FocusListener objects.
        protected void processFocusEvent(FocusEvent e)
        Description copied from class: Component
        Processes focus events occurring on this component by dispatching them to any registered FocusListener objects.

        This method is not called unless focus events are enabled for this component. Focus events are enabled when one of the following occurs:

        • A FocusListener object is registered via addFocusListener.
        • Focus events are enabled via enableEvents.

        If focus events are enabled for a Component, the current KeyboardFocusManager determines whether or not a focus event should be dispatched to registered FocusListener objects. If the events are to be dispatched, the KeyboardFocusManager calls the Component's dispatchEvent method, which results in a call to the Component's processFocusEvent method.

        If focus events are enabled for a Component, calling the Component's dispatchEvent method with a FocusEvent as the argument will result in a call to the Component's processFocusEvent method regardless of the current KeyboardFocusManager.

        Note that if the event parameter is null the behavior is unspecified and may result in an exception.

        Parameters:
        e - the focus event
        Since:
        JDK1.1
        See Also:
        FocusEvent, FocusListener, KeyboardFocusManager, Component.addFocusListener(java.awt.event.FocusListener), Component.enableEvents(long), Component.dispatchEvent(java.awt.AWTEvent)
        Inherited member indicator processHierarchyBoundsEvent Reveal DetailHide Detail
        protected void processHierarchyBoundsEvent(HierarchyEvent e)
        Processes hierarchy bounds events occurring on this component by dispatching them to any registered HierarchyBoundsListener objects.
        protected void processHierarchyBoundsEvent(HierarchyEvent e)
        Description copied from class: Component
        Processes hierarchy bounds events occurring on this component by dispatching them to any registered HierarchyBoundsListener objects.

        This method is not called unless hierarchy bounds events are enabled for this component. Hierarchy bounds events are enabled when one of the following occurs:

        • An HierarchyBoundsListener object is registered via addHierarchyBoundsListener.
        • Hierarchy bounds events are enabled via enableEvents.

        Note that if the event parameter is null the behavior is unspecified and may result in an exception.

        Parameters:
        e - the hierarchy event
        Since:
        1.3
        See Also:
        HierarchyEvent, HierarchyBoundsListener, Component.addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener), Component.enableEvents(long)
        Inherited member indicator processHierarchyEvent Reveal DetailHide Detail
        protected void processHierarchyEvent(HierarchyEvent e)
        Processes hierarchy events occurring on this component by dispatching them to any registered HierarchyListener objects.
        protected void processHierarchyEvent(HierarchyEvent e)
        Description copied from class: Component
        Processes hierarchy events occurring on this component by dispatching them to any registered HierarchyListener objects.

        This method is not called unless hierarchy events are enabled for this component. Hierarchy events are enabled when one of the following occurs:

        • An HierarchyListener object is registered via addHierarchyListener.
        • Hierarchy events are enabled via enableEvents.

        Note that if the event parameter is null the behavior is unspecified and may result in an exception.

        Parameters:
        e - the hierarchy event
        Since:
        1.3
        See Also:
        HierarchyEvent, HierarchyListener, Component.addHierarchyListener(java.awt.event.HierarchyListener), Component.enableEvents(long)
        Inherited member indicator processInputMethodEvent Reveal DetailHide Detail
        protected void processInputMethodEvent(InputMethodEvent e)
        Processes input method events occurring on this component by dispatching them to any registered InputMethodListener objects.
        protected void processInputMethodEvent(InputMethodEvent e)
        Description copied from class: Component
        Processes input method events occurring on this component by dispatching them to any registered InputMethodListener objects.

        This method is not called unless input method events are enabled for this component. Input method events are enabled when one of the following occurs:

        • An InputMethodListener object is registered via addInputMethodListener.
        • Input method events are enabled via enableEvents.

        Note that if the event parameter is null the behavior is unspecified and may result in an exception.

        Parameters:
        e - the input method event
        Since:
        1.2
        See Also:
        InputMethodEvent, InputMethodListener, Component.addInputMethodListener(java.awt.event.InputMethodListener), Component.enableEvents(long)
        Inherited member indicator processKeyEvent Reveal DetailHide Detail
        protected void processKeyEvent(KeyEvent e)
        Processes key events occurring on this component by dispatching them to any registered KeyListener objects.
        protected void processKeyEvent(KeyEvent e)
        Description copied from class: Component
        Processes key events occurring on this component by dispatching them to any registered KeyListener objects.

        This method is not called unless key events are enabled for this component. Key events are enabled when one of the following occurs:

        • A KeyListener object is registered via addKeyListener.
        • Key events are enabled via enableEvents.

        If key events are enabled for a Component, the current KeyboardFocusManager determines whether or not a key event should be dispatched to registered KeyListener objects. The DefaultKeyboardFocusManager will not dispatch key events to a Component that is not the focus owner or is not showing.

        As of J2SE 1.4, KeyEvents are redirected to the focus owner. Please see the Focus Specification for further information.

        Calling a Component's dispatchEvent method with a KeyEvent as the argument will result in a call to the Component's processKeyEvent method regardless of the current KeyboardFocusManager as long as the component is showing, focused, and enabled, and key events are enabled on it.

        If the event parameter is null the behavior is unspecified and may result in an exception.

        Parameters:
        e - the key event
        Since:
        JDK1.1
        See Also:
        KeyEvent, KeyListener, KeyboardFocusManager, DefaultKeyboardFocusManager, Component.processEvent(java.awt.AWTEvent), Component.dispatchEvent(java.awt.AWTEvent), Component.addKeyListener(java.awt.event.KeyListener), Component.enableEvents(long), Component.isShowing()
        Inherited member indicator processMouseEvent Reveal DetailHide Detail
        protected void processMouseEvent(MouseEvent e)
        Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects.
        protected void processMouseEvent(MouseEvent e)
        Description copied from class: Component
        Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects.

        This method is not called unless mouse events are enabled for this component. Mouse events are enabled when one of the following occurs:

        • A MouseListener object is registered via addMouseListener.
        • Mouse events are enabled via enableEvents.

        Note that if the event parameter is null the behavior is unspecified and may result in an exception.

        Parameters:
        e - the mouse event
        Since:
        JDK1.1
        See Also:
        MouseEvent, MouseListener, Component.addMouseListener(java.awt.event.MouseListener), Component.enableEvents(long)
        Inherited member indicator processMouseMotionEvent Reveal DetailHide Detail
        protected void processMouseMotionEvent(MouseEvent e)
        Processes mouse motion events occurring on this component by dispatching them to any registered MouseMotionListener objects.
        protected void processMouseMotionEvent(MouseEvent e)
        Description copied from class: Component
        Processes mouse motion events occurring on this component by dispatching them to any registered MouseMotionListener objects.

        This method is not called unless mouse motion events are enabled for this component. Mouse motion events are enabled when one of the following occurs:

        • A MouseMotionListener object is registered via addMouseMotionListener.
        • Mouse motion events are enabled via enableEvents.

        Note that if the event parameter is null the behavior is unspecified and may result in an exception.

        Parameters:
        e - the mouse motion event
        Since:
        JDK1.1
        See Also:
        MouseEvent, MouseMotionListener, Component.addMouseMotionListener(java.awt.event.MouseMotionListener), Component.enableEvents(long)
        Overridden member indicator processMouseWheelEvent Reveal DetailHide Detail
        protected void processMouseWheelEvent(MouseWheelEvent e)
        Process mouse wheel events that are delivered to this ScrollPane by scrolling an appropriate amount.
        protected void processMouseWheelEvent(MouseWheelEvent e)
        Process mouse wheel events that are delivered to this ScrollPane by scrolling an appropriate amount.

        Note that if the event parameter is null the behavior is unspecified and may result in an exception.

        Overrides:
        processMouseWheelEvent in class Component
        Parameters:
        e - the mouse wheel event
        Since:
        1.4
        See Also:
        MouseWheelEvent, MouseWheelListener, Component.addMouseWheelListener(java.awt.event.MouseWheelListener), Component.enableEvents(long)
      • Event Registration Methods 
        Modifier and Type Method and Description
        Inherited member indicator addComponentListener Reveal DetailHide Detail
        void addComponentListener(ComponentListener l)
        Adds the specified component listener to receive component events from this component.
        public void addComponentListener(ComponentListener l)
        Description copied from class: Component
        Adds the specified component listener to receive component events from this component. If listener l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the component listener
        Since:
        JDK1.1
        See Also:
        ComponentEvent, ComponentListener, Component.removeComponentListener(java.awt.event.ComponentListener), Component.getComponentListeners()
        Inherited member indicator addContainerListener Reveal DetailHide Detail
        void addContainerListener(ContainerListener l)
        Adds the specified container listener to receive container events from this container.
        public void addContainerListener(ContainerListener l)
        Description copied from class: Container
        Adds the specified container listener to receive container events from this container. If l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the container listener
        See Also:
        Container.removeContainerListener(java.awt.event.ContainerListener), Container.getContainerListeners()
        Inherited member indicator addFocusListener Reveal DetailHide Detail
        void addFocusListener(FocusListener l)
        Adds the specified focus listener to receive focus events from this component when this component gains input focus.
        public void addFocusListener(FocusListener l)
        Description copied from class: Component
        Adds the specified focus listener to receive focus events from this component when this component gains input focus. If listener l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the focus listener
        Since:
        JDK1.1
        See Also:
        FocusEvent, FocusListener, Component.removeFocusListener(java.awt.event.FocusListener), Component.getFocusListeners()
        Inherited member indicator addHierarchyBoundsListener Reveal DetailHide Detail
        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.
        public void addHierarchyBoundsListener(HierarchyBoundsListener l)
        Description copied from class: Component
        Adds the specified hierarchy bounds listener to receive hierarchy bounds events from this component when the hierarchy to which this container belongs changes. If listener l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the hierarchy bounds listener
        Since:
        1.3
        See Also:
        HierarchyEvent, HierarchyBoundsListener, Component.removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener), Component.getHierarchyBoundsListeners()
        Inherited member indicator addHierarchyListener Reveal DetailHide Detail
        void addHierarchyListener(HierarchyListener l)
        Adds the specified hierarchy listener to receive hierarchy changed events from this component when the hierarchy to which this container belongs changes.
        public void addHierarchyListener(HierarchyListener l)
        Description copied from class: Component
        Adds the specified hierarchy listener to receive hierarchy changed events from this component when the hierarchy to which this container belongs changes. If listener l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the hierarchy listener
        Since:
        1.3
        See Also:
        HierarchyEvent, HierarchyListener, Component.removeHierarchyListener(java.awt.event.HierarchyListener), Component.getHierarchyListeners()
        Inherited member indicator addInputMethodListener Reveal DetailHide Detail
        void addInputMethodListener(InputMethodListener l)
        Adds the specified input method listener to receive input method events from this component.
        public void addInputMethodListener(InputMethodListener l)
        Description copied from class: Component
        Adds the specified input method listener to receive input method events from this component. A component will only receive input method events from input methods if it also overrides getInputMethodRequests to return an InputMethodRequests instance. If listener l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the input method listener
        Since:
        1.2
        See Also:
        InputMethodEvent, InputMethodListener, Component.removeInputMethodListener(java.awt.event.InputMethodListener), Component.getInputMethodListeners(), Component.getInputMethodRequests()
        Inherited member indicator addKeyListener Reveal DetailHide Detail
        void addKeyListener(KeyListener l)
        Adds the specified key listener to receive key events from this component.
        public void addKeyListener(KeyListener l)
        Description copied from class: Component
        Adds the specified key listener to receive key events from this component. If l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the key listener.
        Since:
        JDK1.1
        See Also:
        KeyEvent, KeyListener, Component.removeKeyListener(java.awt.event.KeyListener), Component.getKeyListeners()
        Inherited member indicator addMouseListener Reveal DetailHide Detail
        void addMouseListener(MouseListener l)
        Adds the specified mouse listener to receive mouse events from this component.
        public void addMouseListener(MouseListener l)
        Description copied from class: Component
        Adds the specified mouse listener to receive mouse events from this component. If listener l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the mouse listener
        Since:
        JDK1.1
        See Also:
        MouseEvent, MouseListener, Component.removeMouseListener(java.awt.event.MouseListener), Component.getMouseListeners()
        Inherited member indicator addMouseMotionListener Reveal DetailHide Detail
        void addMouseMotionListener(MouseMotionListener l)
        Adds the specified mouse motion listener to receive mouse motion events from this component.
        public void addMouseMotionListener(MouseMotionListener l)
        Description copied from class: Component
        Adds the specified mouse motion listener to receive mouse motion events from this component. If listener l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the mouse motion listener
        Since:
        JDK1.1
        See Also:
        MouseEvent, MouseMotionListener, Component.removeMouseMotionListener(java.awt.event.MouseMotionListener), Component.getMouseMotionListeners()
        Inherited member indicator addMouseWheelListener Reveal DetailHide Detail
        void addMouseWheelListener(MouseWheelListener l)
        Adds the specified mouse wheel listener to receive mouse wheel events from this component.
        public void addMouseWheelListener(MouseWheelListener l)
        Description copied from class: Component
        Adds the specified mouse wheel listener to receive mouse wheel events from this component. Containers also receive mouse wheel events from sub-components.

        For information on how mouse wheel events are dispatched, see the class description for MouseWheelEvent.

        If l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the mouse wheel listener
        Since:
        1.4
        See Also:
        MouseWheelEvent, MouseWheelListener, Component.removeMouseWheelListener(java.awt.event.MouseWheelListener), Component.getMouseWheelListeners()
        Inherited member indicator addPropertyChangeListener Reveal DetailHide Detail
        void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
        Adds a PropertyChangeListener to the listener list.
        public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
        Description copied from class: Container
        Adds a PropertyChangeListener to the listener list. The listener is registered for all bound properties of this class, including the following:
        • this Container's font ("font")
        • this Container's background color ("background")
        • this Container's foreground color ("foreground")
        • this Container's focusability ("focusable")
        • this Container's focus traversal keys enabled state ("focusTraversalKeysEnabled")
        • this Container's Set of FORWARD_TRAVERSAL_KEYS ("forwardFocusTraversalKeys")
        • this Container's Set of BACKWARD_TRAVERSAL_KEYS ("backwardFocusTraversalKeys")
        • this Container's Set of UP_CYCLE_TRAVERSAL_KEYS ("upCycleFocusTraversalKeys")
        • this Container's Set of DOWN_CYCLE_TRAVERSAL_KEYS ("downCycleFocusTraversalKeys")
        • this Container's focus traversal policy ("focusTraversalPolicy")
        • this Container's focus-cycle-root state ("focusCycleRoot")
        Note that if this Container is inheriting a bound property, then no event will be fired in response to a change in the inherited property.

        If listener is null, no exception is thrown and no action is performed.

        Overrides:
        addPropertyChangeListener in class Component
        Parameters:
        listener - the PropertyChangeListener to be added
        See Also:
        Component.removePropertyChangeListener(java.beans.PropertyChangeListener), Container.addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)
        Inherited member indicator addPropertyChangeListener Reveal DetailHide Detail
        void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
        Adds a PropertyChangeListener to the listener list for a specific property.
        public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
        Description copied from class: Container
        Adds a PropertyChangeListener to the listener list for a specific property. The specified property may be user-defined, or one of the following defaults:
        • this Container's font ("font")
        • this Container's background color ("background")
        • this Container's foreground color ("foreground")
        • this Container's focusability ("focusable")
        • this Container's focus traversal keys enabled state ("focusTraversalKeysEnabled")
        • this Container's Set of FORWARD_TRAVERSAL_KEYS ("forwardFocusTraversalKeys")
        • this Container's Set of BACKWARD_TRAVERSAL_KEYS ("backwardFocusTraversalKeys")
        • this Container's Set of UP_CYCLE_TRAVERSAL_KEYS ("upCycleFocusTraversalKeys")
        • this Container's Set of DOWN_CYCLE_TRAVERSAL_KEYS ("downCycleFocusTraversalKeys")
        • this Container's focus traversal policy ("focusTraversalPolicy")
        • this Container's focus-cycle-root state ("focusCycleRoot")
        • this Container's focus-traversal-policy-provider state("focusTraversalPolicyProvider")
        • this Container's focus-traversal-policy-provider state("focusTraversalPolicyProvider")
        Note that if this Container is inheriting a bound property, then no event will be fired in response to a change in the inherited property.

        If listener is null, no exception is thrown and no action is performed.

        Overrides:
        addPropertyChangeListener in class Component
        Parameters:
        propertyName - one of the property names listed above
        listener - the PropertyChangeListener to be added
        See Also:
        Container.addPropertyChangeListener(java.beans.PropertyChangeListener), Component.removePropertyChangeListener(java.beans.PropertyChangeListener)
        Inherited member indicator getComponentListeners Reveal DetailHide Detail
        ComponentListener[] getComponentListeners()
        Returns an array of all the component listeners registered on this component.
        public ComponentListener[] getComponentListeners()
        Description copied from class: Component
        Returns an array of all the component listeners registered on this component.
        Returns:
        all of this comonent's ComponentListeners or an empty array if no component listeners are currently registered
        Since:
        1.4
        See Also:
        Component.addComponentListener(java.awt.event.ComponentListener), Component.removeComponentListener(java.awt.event.ComponentListener)
        Inherited member indicator getContainerListeners Reveal DetailHide Detail
        ContainerListener[] getContainerListeners()
        Returns an array of all the container listeners registered on this container.
        public ContainerListener[] getContainerListeners()
        Description copied from class: Container
        Returns an array of all the container listeners registered on this container.
        Returns:
        all of this container's ContainerListeners or an empty array if no container listeners are currently registered
        Since:
        1.4
        See Also:
        Container.addContainerListener(java.awt.event.ContainerListener), Container.removeContainerListener(java.awt.event.ContainerListener)
        Inherited member indicator getFocusListeners Reveal DetailHide Detail
        FocusListener[] getFocusListeners()
        Returns an array of all the focus listeners registered on this component.
        public FocusListener[] getFocusListeners()
        Description copied from class: Component
        Returns an array of all the focus listeners registered on this component.
        Returns:
        all of this component's FocusListeners or an empty array if no component listeners are currently registered
        Since:
        1.4
        See Also:
        Component.addFocusListener(java.awt.event.FocusListener), Component.removeFocusListener(java.awt.event.FocusListener)
        Inherited member indicator getHierarchyBoundsListeners Reveal DetailHide Detail
        HierarchyBoundsListener[] getHierarchyBoundsListeners()
        Returns an array of all the hierarchy bounds listeners registered on this component.
        public HierarchyBoundsListener[] getHierarchyBoundsListeners()
        Description copied from class: Component
        Returns an array of all the hierarchy bounds listeners registered on this component.
        Returns:
        all of this component's HierarchyBoundsListeners or an empty array if no hierarchy bounds listeners are currently registered
        Since:
        1.4
        See Also:
        Component.addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener), Component.removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener)
        Inherited member indicator getHierarchyListeners Reveal DetailHide Detail
        HierarchyListener[] getHierarchyListeners()
        Returns an array of all the hierarchy listeners registered on this component.
        public HierarchyListener[] getHierarchyListeners()
        Description copied from class: Component
        Returns an array of all the hierarchy listeners registered on this component.
        Returns:
        all of this component's HierarchyListeners or an empty array if no hierarchy listeners are currently registered
        Since:
        1.4
        See Also:
        Component.addHierarchyListener(java.awt.event.HierarchyListener), Component.removeHierarchyListener(java.awt.event.HierarchyListener)
        Inherited member indicator getInputMethodListeners Reveal DetailHide Detail
        InputMethodListener[] getInputMethodListeners()
        Returns an array of all the input method listeners registered on this component.
        public InputMethodListener[] getInputMethodListeners()
        Description copied from class: Component
        Returns an array of all the input method listeners registered on this component.
        Returns:
        all of this component's InputMethodListeners or an empty array if no input method listeners are currently registered
        Since:
        1.4
        See Also:
        Component.addInputMethodListener(java.awt.event.InputMethodListener), Component.removeInputMethodListener(java.awt.event.InputMethodListener)
        Inherited member indicator getKeyListeners Reveal DetailHide Detail
        KeyListener[] getKeyListeners()
        Returns an array of all the key listeners registered on this component.
        public KeyListener[] getKeyListeners()
        Description copied from class: Component
        Returns an array of all the key listeners registered on this component.
        Returns:
        all of this component's KeyListeners or an empty array if no key listeners are currently registered
        Since:
        1.4
        See Also:
        Component.addKeyListener(java.awt.event.KeyListener), Component.removeKeyListener(java.awt.event.KeyListener)
        Inherited member indicator getMouseListeners Reveal DetailHide Detail
        MouseListener[] getMouseListeners()
        Returns an array of all the mouse listeners registered on this component.
        public MouseListener[] getMouseListeners()
        Description copied from class: Component
        Returns an array of all the mouse listeners registered on this component.
        Returns:
        all of this component's MouseListeners or an empty array if no mouse listeners are currently registered
        Since:
        1.4
        See Also:
        Component.addMouseListener(java.awt.event.MouseListener), Component.removeMouseListener(java.awt.event.MouseListener)
        Inherited member indicator getMouseMotionListeners Reveal DetailHide Detail
        MouseMotionListener[] getMouseMotionListeners()
        Returns an array of all the mouse motion listeners registered on this component.
        public MouseMotionListener[] getMouseMotionListeners()
        Description copied from class: Component
        Returns an array of all the mouse motion listeners registered on this component.
        Returns:
        all of this component's MouseMotionListeners or an empty array if no mouse motion listeners are currently registered
        Since:
        1.4
        See Also:
        Component.addMouseMotionListener(java.awt.event.MouseMotionListener), Component.removeMouseMotionListener(java.awt.event.MouseMotionListener)
        Inherited member indicator getMouseWheelListeners Reveal DetailHide Detail
        MouseWheelListener[] getMouseWheelListeners()
        Returns an array of all the mouse wheel listeners registered on this component.
        public MouseWheelListener[] getMouseWheelListeners()
        Description copied from class: Component
        Returns an array of all the mouse wheel listeners registered on this component.
        Returns:
        all of this component's MouseWheelListeners or an empty array if no mouse wheel listeners are currently registered
        Since:
        1.4
        See Also:
        Component.addMouseWheelListener(java.awt.event.MouseWheelListener), Component.removeMouseWheelListener(java.awt.event.MouseWheelListener)
        Inherited member indicator getPropertyChangeListeners Reveal DetailHide Detail
        java.beans.PropertyChangeListener[] getPropertyChangeListeners()
        Returns an array of all the property change listeners registered on this component.
        public java.beans.PropertyChangeListener[] getPropertyChangeListeners()
        Description copied from class: Component
        Returns an array of all the property change listeners registered on this component.
        Returns:
        all of this component's PropertyChangeListeners or an empty array if no property change listeners are currently registered
        Since:
        1.4
        See Also:
        Component.addPropertyChangeListener(java.beans.PropertyChangeListener), Component.removePropertyChangeListener(java.beans.PropertyChangeListener), Component.getPropertyChangeListeners(java.lang.String), PropertyChangeSupport.getPropertyChangeListeners()
        Inherited member indicator getPropertyChangeListeners Reveal DetailHide Detail
        java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String propertyName)
        Returns an array of all the listeners which have been associated with the named property.
        public java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String propertyName)
        Description copied from class: Component
        Returns an array of all the listeners which have been associated with the named property.
        Returns:
        all of the PropertyChangeListeners associated with the named property; if no such listeners have been added or if propertyName is null, an empty array is returned
        Since:
        1.4
        See Also:
        Component.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener), Component.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener), Component.getPropertyChangeListeners()
        Inherited member indicator removeComponentListener Reveal DetailHide Detail
        void removeComponentListener(ComponentListener l)
        Removes the specified component listener so that it no longer receives component events from this component.
        public void removeComponentListener(ComponentListener l)
        Description copied from class: Component
        Removes the specified component listener so that it no longer receives component events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If listener l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the component listener
        Since:
        JDK1.1
        See Also:
        ComponentEvent, ComponentListener, Component.addComponentListener(java.awt.event.ComponentListener), Component.getComponentListeners()
        Inherited member indicator removeContainerListener Reveal DetailHide Detail
        void removeContainerListener(ContainerListener l)
        Removes the specified container listener so it no longer receives container events from this container.
        public void removeContainerListener(ContainerListener l)
        Description copied from class: Container
        Removes the specified container listener so it no longer receives container events from this container. If l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the container listener
        See Also:
        Container.addContainerListener(java.awt.event.ContainerListener), Container.getContainerListeners()
        Inherited member indicator removeFocusListener Reveal DetailHide Detail
        void removeFocusListener(FocusListener l)
        Removes the specified focus listener so that it no longer receives focus events from this component.
        public void removeFocusListener(FocusListener l)
        Description copied from class: Component
        Removes the specified focus listener so that it no longer receives focus events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If listener l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the focus listener
        Since:
        JDK1.1
        See Also:
        FocusEvent, FocusListener, Component.addFocusListener(java.awt.event.FocusListener), Component.getFocusListeners()
        Inherited member indicator removeHierarchyBoundsListener Reveal DetailHide Detail
        void removeHierarchyBoundsListener(HierarchyBoundsListener l)
        Removes the specified hierarchy bounds listener so that it no longer receives hierarchy bounds events from this component.
        public void removeHierarchyBoundsListener(HierarchyBoundsListener l)
        Description copied from class: Component
        Removes the specified hierarchy bounds listener so that it no longer receives hierarchy bounds events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If listener l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the hierarchy bounds listener
        Since:
        1.3
        See Also:
        HierarchyEvent, HierarchyBoundsListener, Component.addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener), Component.getHierarchyBoundsListeners()
        Inherited member indicator removeHierarchyListener Reveal DetailHide Detail
        void removeHierarchyListener(HierarchyListener l)
        Removes the specified hierarchy listener so that it no longer receives hierarchy changed events from this component.
        public void removeHierarchyListener(HierarchyListener l)
        Description copied from class: Component
        Removes the specified hierarchy listener so that it no longer receives hierarchy changed events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If listener l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the hierarchy listener
        Since:
        1.3
        See Also:
        HierarchyEvent, HierarchyListener, Component.addHierarchyListener(java.awt.event.HierarchyListener), Component.getHierarchyListeners()
        Inherited member indicator removeInputMethodListener Reveal DetailHide Detail
        void removeInputMethodListener(InputMethodListener l)
        Removes the specified input method listener so that it no longer receives input method events from this component.
        public void removeInputMethodListener(InputMethodListener l)
        Description copied from class: Component
        Removes the specified input method listener so that it no longer receives input method events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If listener l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the input method listener
        Since:
        1.2
        See Also:
        InputMethodEvent, InputMethodListener, Component.addInputMethodListener(java.awt.event.InputMethodListener), Component.getInputMethodListeners()
        Inherited member indicator removeKeyListener Reveal DetailHide Detail
        void removeKeyListener(KeyListener l)
        Removes the specified key listener so that it no longer receives key events from this component.
        public void removeKeyListener(KeyListener l)
        Description copied from class: Component
        Removes the specified key listener so that it no longer receives key events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If listener l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the key listener
        Since:
        JDK1.1
        See Also:
        KeyEvent, KeyListener, Component.addKeyListener(java.awt.event.KeyListener), Component.getKeyListeners()
        Inherited member indicator removeMouseListener Reveal DetailHide Detail
        void removeMouseListener(MouseListener l)
        Removes the specified mouse listener so that it no longer receives mouse events from this component.
        public void removeMouseListener(MouseListener l)
        Description copied from class: Component
        Removes the specified mouse listener so that it no longer receives mouse events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If listener l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the mouse listener
        Since:
        JDK1.1
        See Also:
        MouseEvent, MouseListener, Component.addMouseListener(java.awt.event.MouseListener), Component.getMouseListeners()
        Inherited member indicator removeMouseMotionListener Reveal DetailHide Detail
        void removeMouseMotionListener(MouseMotionListener l)
        Removes the specified mouse motion listener so that it no longer receives mouse motion events from this component.
        public void removeMouseMotionListener(MouseMotionListener l)
        Description copied from class: Component
        Removes the specified mouse motion listener so that it no longer receives mouse motion events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If listener l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the mouse motion listener
        Since:
        JDK1.1
        See Also:
        MouseEvent, MouseMotionListener, Component.addMouseMotionListener(java.awt.event.MouseMotionListener), Component.getMouseMotionListeners()
        Inherited member indicator removeMouseWheelListener Reveal DetailHide Detail
        void removeMouseWheelListener(MouseWheelListener l)
        Removes the specified mouse wheel listener so that it no longer receives mouse wheel events from this component.
        public void removeMouseWheelListener(MouseWheelListener l)
        Description copied from class: Component
        Removes the specified mouse wheel listener so that it no longer receives mouse wheel events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If l is null, no exception is thrown and no action is performed.

        Refer to AWT Threading Issues for details on AWT's threading model.

        Parameters:
        l - the mouse wheel listener.
        Since:
        1.4
        See Also:
        MouseWheelEvent, MouseWheelListener, Component.addMouseWheelListener(java.awt.event.MouseWheelListener), Component.getMouseWheelListeners()
        Inherited member indicator removePropertyChangeListener Reveal DetailHide Detail
        void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
        Removes a PropertyChangeListener from the listener list.
        public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
        Description copied from class: Component
        Removes a PropertyChangeListener from the listener list. This method should be used to remove PropertyChangeListeners that were registered for all bound properties of this class.

        If listener is null, no exception is thrown and no action is performed.

        Parameters:
        listener - the PropertyChangeListener to be removed
        See Also:
        Component.addPropertyChangeListener(java.beans.PropertyChangeListener), Component.getPropertyChangeListeners(), Component.removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)
        Inherited member indicator removePropertyChangeListener Reveal DetailHide Detail
        void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
        Removes a PropertyChangeListener from the listener list for a specific property.
        public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
        Description copied from class: Component
        Removes a PropertyChangeListener from the listener list for a specific property. This method should be used to remove PropertyChangeListeners that were registered for a specific bound property.

        If propertyName or listener is null, no exception is thrown and no action is taken.

        Parameters:
        propertyName - a valid property name
        listener - the PropertyChangeListener to be removed
        See Also:
        Component.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener), Component.getPropertyChangeListeners(java.lang.String), Component.removePropertyChangeListener(java.beans.PropertyChangeListener)
      • Keyboard Focus Methods 
        Modifier and Type Method and Description
        Inherited member indicator areFocusTraversalKeysSet Reveal DetailHide Detail
        boolean areFocusTraversalKeysSet(int id)
        Returns whether the Set of focus traversal keys for the given focus traversal operation has been explicitly defined for this Container.
        public boolean areFocusTraversalKeysSet(int id)
        Description copied from class: Container
        Returns whether the Set of focus traversal keys for the given focus traversal operation has been explicitly defined for this Container. If this method returns false, this Container is inheriting the Set from an ancestor, or from the current KeyboardFocusManager.
        Overrides:
        areFocusTraversalKeysSet in class Component
        Parameters:
        id - one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
        Returns:
        true if the the Set of focus traversal keys for the given focus traversal operation has been explicitly defined for this Component; false otherwise.
        Throws:
        java.lang.IllegalArgumentException - if id is not one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
        Since:
        1.4
        Inherited member indicator getFocusCycleRootAncestor Reveal DetailHide Detail
        Container getFocusCycleRootAncestor()
        Returns the Container which is the focus cycle root of this Component's focus traversal cycle.
        public Container getFocusCycleRootAncestor()
        Description copied from class: Component
        Returns the Container which is the focus cycle root of this Component's focus traversal cycle. Each focus traversal cycle has only a single focus cycle root and each Component which is not a Container belongs to only a single focus traversal cycle. Containers which are focus cycle roots belong to two cycles: one rooted at the Container itself, and one rooted at the Container's nearest focus-cycle-root ancestor. For such Containers, this method will return the Container's nearest focus-cycle- root ancestor.
        Returns:
        this Component's nearest focus-cycle-root ancestor
        Since:
        1.4
        See Also:
        Container.isFocusCycleRoot()
        Inherited member indicator getFocusTraversalKeys Reveal DetailHide Detail
        java.util.Set<AWTKeyStroke> getFocusTraversalKeys(int id)
        Returns the Set of focus traversal keys for a given traversal operation for this Container.
        public java.util.Set<AWTKeyStroke> getFocusTraversalKeys(int id)
        Description copied from class: Container
        Returns the Set of focus traversal keys for a given traversal operation for this Container. (See setFocusTraversalKeys for a full description of each key.)

        If a Set of traversal keys has not been explicitly defined for this Container, then this Container's parent's Set is returned. If no Set has been explicitly defined for any of this Container's ancestors, then the current KeyboardFocusManager's default Set is returned.

        Overrides:
        getFocusTraversalKeys in class Component
        Parameters:
        id - one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
        Returns:
        the Set of AWTKeyStrokes for the specified operation. The Set will be unmodifiable, and may be empty. null will never be returned.
        Throws:
        java.lang.IllegalArgumentException - if id is not one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
        Since:
        1.4
        See Also:
        Container.setFocusTraversalKeys(int, java.util.Set<? extends java.awt.AWTKeyStroke>), KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
        Inherited member indicator getFocusTraversalKeysEnabled Reveal DetailHide Detail
        boolean getFocusTraversalKeysEnabled()
        Returns whether focus traversal keys are enabled for this Component.
        public boolean getFocusTraversalKeysEnabled()
        Description copied from class: Component
        Returns whether focus traversal keys are enabled for this Component. Components for which focus traversal keys are disabled receive key events for focus traversal keys. Components for which focus traversal keys are enabled do not see these events; instead, the events are automatically converted to traversal operations.
        Returns:
        whether focus traversal keys are enabled for this Component
        Since:
        1.4
        See Also:
        Component.setFocusTraversalKeysEnabled(boolean), Component.setFocusTraversalKeys(int, java.util.Set<? extends java.awt.AWTKeyStroke>), Component.getFocusTraversalKeys(int)
        Inherited member indicator getFocusTraversalPolicy Reveal DetailHide Detail
        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.
        public FocusTraversalPolicy getFocusTraversalPolicy()
        Description copied from class: Container
        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. If no traversal policy has been explicitly set for this Container, then this Container's focus-cycle-root ancestor's policy is returned.
        Returns:
        this Container's focus traversal policy, or null if this Container is not a focus cycle root.
        Since:
        1.4
        See Also:
        Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy), Container.setFocusCycleRoot(boolean), Container.isFocusCycleRoot(java.awt.Container)
        Inherited member indicator gotFocus Reveal DetailHide Detail
        boolean gotFocus(Event evt, java.lang.Object what)
        Deprecated. As of JDK version 1.1, replaced by processFocusEvent(FocusEvent).
        @Deprecated public boolean gotFocus(Event evt, java.lang.Object what)
        Deprecated. As of JDK version 1.1, replaced by processFocusEvent(FocusEvent).
        Inherited member indicator hasFocus Reveal DetailHide Detail
        boolean hasFocus()
        Returns true if this Component is the focus owner.
        public boolean hasFocus()
        Description copied from class: Component
        Returns true if this Component is the focus owner. This method is obsolete, and has been replaced by isFocusOwner().
        Returns:
        true if this Component is the focus owner; false otherwise
        Since:
        1.2
        Inherited member indicator isFocusable Reveal DetailHide Detail
        boolean isFocusable()
        Returns whether this Component can be focused.
        public boolean isFocusable()
        Description copied from class: Component
        Returns whether this Component can be focused.
        Returns:
        true if this Component is focusable; false otherwise.
        Since:
        1.4
        See Also:
        Component.setFocusable(boolean)
        Inherited member indicator isFocusCycleRoot Reveal DetailHide Detail
        boolean isFocusCycleRoot()
        Returns whether this Container is the root of a focus traversal cycle.
        public boolean isFocusCycleRoot()
        Description copied from class: Container
        Returns whether this Container is the root of a focus traversal cycle. Once focus enters a traversal cycle, typically it cannot leave it via focus traversal unless one of the up- or down-cycle keys is pressed. Normal traversal is limited to this Container, and all of this Container's descendants that are not descendants of inferior focus cycle roots. Note that a FocusTraversalPolicy may bend these restrictions, however. For example, ContainerOrderFocusTraversalPolicy supports implicit down-cycle traversal.
        Returns:
        whether this Container is the root of a focus traversal cycle
        Since:
        1.4
        See Also:
        Container.setFocusCycleRoot(boolean), Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy), Container.getFocusTraversalPolicy(), ContainerOrderFocusTraversalPolicy
        Inherited member indicator isFocusCycleRoot Reveal DetailHide Detail
        boolean isFocusCycleRoot(Container container)
        Returns whether the specified Container is the focus cycle root of this Container's focus traversal cycle.
        public boolean isFocusCycleRoot(Container container)
        Description copied from class: Container
        Returns whether the specified Container is the focus cycle root of this Container's focus traversal cycle. Each focus traversal cycle has only a single focus cycle root and each Container which is not a focus cycle root belongs to only a single focus traversal cycle. Containers which are focus cycle roots belong to two cycles: one rooted at the Container itself, and one rooted at the Container's nearest focus-cycle-root ancestor. This method will return true for both such Containers in this case.
        Overrides:
        isFocusCycleRoot in class Component
        Parameters:
        container - the Container to be tested
        Returns:
        true if the specified Container is a focus-cycle- root of this Container; false otherwise
        Since:
        1.4
        See Also:
        Container.isFocusCycleRoot()
        Inherited member indicator isFocusOwner Reveal DetailHide Detail
        boolean isFocusOwner()
        Returns true if this Component is the focus owner.
        public boolean isFocusOwner()
        Description copied from class: Component
        Returns true if this Component is the focus owner.
        Returns:
        true if this Component is the focus owner; false otherwise
        Since:
        1.4
        Inherited member indicator isFocusTraversable Reveal DetailHide Detail
        boolean isFocusTraversable()
        Deprecated. As of 1.4, replaced by isFocusable().
        @Deprecated public boolean isFocusTraversable()
        Deprecated. As of 1.4, replaced by isFocusable().
        Description copied from class: Component
        Returns whether this Component can become the focus owner.
        Returns:
        true if this Component is focusable; false otherwise
        Since:
        JDK1.1
        See Also:
        Component.setFocusable(boolean)
        Inherited member indicator isFocusTraversalPolicyProvider Reveal DetailHide Detail
        boolean isFocusTraversalPolicyProvider()
        Returns whether this container provides focus traversal policy.
        public final boolean isFocusTraversalPolicyProvider()
        Description copied from class: Container
        Returns whether this container provides focus traversal policy. If this property is set to true then when keyboard focus manager searches container hierarchy for focus traversal policy and encounters this container before any other container with this property as true or focus cycle roots then its focus traversal policy will be used instead of focus cycle root's policy.
        Returns:
        true if this container provides focus traversal policy, false otherwise
        Since:
        1.5
        See Also:
        Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy), Container.getFocusTraversalPolicy(), Container.setFocusCycleRoot(boolean), Container.setFocusTraversalPolicyProvider(boolean)
        Inherited member indicator isFocusTraversalPolicySet Reveal DetailHide Detail
        boolean isFocusTraversalPolicySet()
        Returns whether the focus traversal policy has been explicitly set for this Container.
        public boolean isFocusTraversalPolicySet()
        Description copied from class: Container
        Returns whether the focus traversal policy has been explicitly set for this Container. If this method returns false, this Container will inherit its focus traversal policy from an ancestor.
        Returns:
        true if the focus traversal policy has been explicitly set for this Container; false otherwise.
        Since:
        1.4
        Inherited member indicator lostFocus Reveal DetailHide Detail
        boolean lostFocus(Event evt, java.lang.Object what)
        Deprecated. As of JDK version 1.1, replaced by processFocusEvent(FocusEvent).
        @Deprecated public boolean lostFocus(Event evt, java.lang.Object what)
        Deprecated. As of JDK version 1.1, replaced by processFocusEvent(FocusEvent).
        Inherited member indicator nextFocus Reveal DetailHide Detail
        void nextFocus()
        Deprecated. As of JDK version 1.1, replaced by transferFocus().
        @Deprecated public void nextFocus()
        Deprecated. As of JDK version 1.1, replaced by transferFocus().
        Inherited member indicator requestFocus Reveal DetailHide Detail
        void requestFocus()
        Requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window.
        public void requestFocus()
        Description copied from class: Component
        Requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window. This component must be displayable, focusable, visible and all of its ancestors (with the exception of the top-level Window) must be visible for the request to be granted. Every effort will be made to honor the request; however, in some cases it may be impossible to do so. Developers must never assume that this Component is the focus owner until this Component receives a FOCUS_GAINED event. If this request is denied because this Component's top-level Window cannot become the focused Window, the request will be remembered and will be granted when the Window is later focused by the user.

        This method cannot be used to set the focus owner to no Component at all. Use KeyboardFocusManager.clearGlobalFocusOwner() instead.

        Because the focus behavior of this method is platform-dependent, developers are strongly encouraged to use requestFocusInWindow when possible.

        Note: Not all focus transfers result from invoking this method. As such, a component may receive focus without this or any of the other requestFocus methods of Component being invoked.

        Since:
        JDK1.0
        See Also:
        Component.requestFocusInWindow(), FocusEvent, Component.addFocusListener(java.awt.event.FocusListener), Component.isFocusable(), Component.isDisplayable(), KeyboardFocusManager.clearGlobalFocusOwner()
        Inherited member indicator requestFocus Reveal DetailHide Detail
        protected boolean requestFocus(boolean temporary)
        Requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window.
        protected boolean requestFocus(boolean temporary)
        Description copied from class: Component
        Requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window. This component must be displayable, focusable, visible and all of its ancestors (with the exception of the top-level Window) must be visible for the request to be granted. Every effort will be made to honor the request; however, in some cases it may be impossible to do so. Developers must never assume that this component is the focus owner until this component receives a FOCUS_GAINED event. If this request is denied because this component's top-level window cannot become the focused window, the request will be remembered and will be granted when the window is later focused by the user.

        This method returns a boolean value. If false is returned, the request is guaranteed to fail. If true is returned, the request will succeed unless it is vetoed, or an extraordinary event, such as disposal of the component's peer, occurs before the request can be granted by the native windowing system. Again, while a return value of true indicates that the request is likely to succeed, developers must never assume that this component is the focus owner until this component receives a FOCUS_GAINED event.

        This method cannot be used to set the focus owner to no component at all. Use KeyboardFocusManager.clearGlobalFocusOwner instead.

        Because the focus behavior of this method is platform-dependent, developers are strongly encouraged to use requestFocusInWindow when possible.

        Every effort will be made to ensure that FocusEvents generated as a result of this request will have the specified temporary value. However, because specifying an arbitrary temporary state may not be implementable on all native windowing systems, correct behavior for this method can be guaranteed only for lightweight Components. This method is not intended for general use, but exists instead as a hook for lightweight component libraries, such as Swing.

        Note: Not all focus transfers result from invoking this method. As such, a component may receive focus without this or any of the other requestFocus methods of Component being invoked.

        Parameters:
        temporary - true if the focus change is temporary, such as when the window loses the focus; for more information on temporary focus changes see the Focus Specification
        Returns:
        false if the focus change request is guaranteed to fail; true if it is likely to succeed
        Since:
        1.4
        See Also:
        FocusEvent, Component.addFocusListener(java.awt.event.FocusListener), Component.isFocusable(), Component.isDisplayable(), KeyboardFocusManager.clearGlobalFocusOwner()
        Inherited member indicator requestFocusInWindow Reveal DetailHide Detail
        boolean requestFocusInWindow()
        Requests that this Component get the input focus, if this Component's top-level ancestor is already the focused Window.
        public boolean requestFocusInWindow()
        Description copied from class: Component
        Requests that this Component get the input focus, if this Component's top-level ancestor is already the focused Window. This component must be displayable, focusable, visible and all of its ancestors (with the exception of the top-level Window) must be visible for the request to be granted. Every effort will be made to honor the request; however, in some cases it may be impossible to do so. Developers must never assume that this Component is the focus owner until this Component receives a FOCUS_GAINED event.

        This method returns a boolean value. If false is returned, the request is guaranteed to fail. If true is returned, the request will succeed unless it is vetoed, or an extraordinary event, such as disposal of the Component's peer, occurs before the request can be granted by the native windowing system. Again, while a return value of true indicates that the request is likely to succeed, developers must never assume that this Component is the focus owner until this Component receives a FOCUS_GAINED event.

        This method cannot be used to set the focus owner to no Component at all. Use KeyboardFocusManager.clearGlobalFocusOwner() instead.

        The focus behavior of this method can be implemented uniformly across platforms, and thus developers are strongly encouraged to use this method over requestFocus when possible. Code which relies on requestFocus may exhibit different focus behavior on different platforms.

        Note: Not all focus transfers result from invoking this method. As such, a component may receive focus without this or any of the other requestFocus methods of Component being invoked.

        Returns:
        false if the focus change request is guaranteed to fail; true if it is likely to succeed
        Since:
        1.4
        See Also:
        Component.requestFocus(), FocusEvent, Component.addFocusListener(java.awt.event.FocusListener), Component.isFocusable(), Component.isDisplayable(), KeyboardFocusManager.clearGlobalFocusOwner()
        Inherited member indicator requestFocusInWindow Reveal DetailHide Detail
        protected boolean requestFocusInWindow(boolean temporary)
        Requests that this Component get the input focus, if this Component's top-level ancestor is already the focused Window.
        protected boolean requestFocusInWindow(boolean temporary)
        Description copied from class: Component
        Requests that this Component get the input focus, if this Component's top-level ancestor is already the focused Window. This component must be displayable, focusable, visible and all of its ancestors (with the exception of the top-level Window) must be visible for the request to be granted. Every effort will be made to honor the request; however, in some cases it may be impossible to do so. Developers must never assume that this component is the focus owner until this component receives a FOCUS_GAINED event.

        This method returns a boolean value. If false is returned, the request is guaranteed to fail. If true is returned, the request will succeed unless it is vetoed, or an extraordinary event, such as disposal of the component's peer, occurs before the request can be granted by the native windowing system. Again, while a return value of true indicates that the request is likely to succeed, developers must never assume that this component is the focus owner until this component receives a FOCUS_GAINED event.

        This method cannot be used to set the focus owner to no component at all. Use KeyboardFocusManager.clearGlobalFocusOwner instead.

        The focus behavior of this method can be implemented uniformly across platforms, and thus developers are strongly encouraged to use this method over requestFocus when possible. Code which relies on requestFocus may exhibit different focus behavior on different platforms.

        Every effort will be made to ensure that FocusEvents generated as a result of this request will have the specified temporary value. However, because specifying an arbitrary temporary state may not be implementable on all native windowing systems, correct behavior for this method can be guaranteed only for lightweight components. This method is not intended for general use, but exists instead as a hook for lightweight component libraries, such as Swing.

        Note: Not all focus transfers result from invoking this method. As such, a component may receive focus without this or any of the other requestFocus methods of Component being invoked.

        Parameters:
        temporary - true if the focus change is temporary, such as when the window loses the focus; for more information on temporary focus changes see the Focus Specification
        Returns:
        false if the focus change request is guaranteed to fail; true if it is likely to succeed
        Since:
        1.4
        See Also:
        Component.requestFocus(), FocusEvent, Component.addFocusListener(java.awt.event.FocusListener), Component.isFocusable(), Component.isDisplayable(), KeyboardFocusManager.clearGlobalFocusOwner()
        Inherited member indicator setFocusable Reveal DetailHide Detail
        void setFocusable(boolean focusable)
        Sets the focusable state of this Component to the specified value.
        public void setFocusable(boolean focusable)
        Description copied from class: Component
        Sets the focusable state of this Component to the specified value. This value overrides the Component's default focusability.
        Parameters:
        focusable - indicates whether this Component is focusable
        Since:
        1.4
        See Also:
        Component.isFocusable()
        Inherited member indicator setFocusCycleRoot Reveal DetailHide Detail
        void setFocusCycleRoot(boolean focusCycleRoot)
        Sets whether this Container is the root of a focus traversal cycle.
        public void setFocusCycleRoot(boolean focusCycleRoot)
        Description copied from class: Container
        Sets whether this Container is the root of a focus traversal cycle. Once focus enters a traversal cycle, typically it cannot leave it via focus traversal unless one of the up- or down-cycle keys is pressed. Normal traversal is limited to this Container, and all of this Container's descendants that are not descendants of inferior focus cycle roots. Note that a FocusTraversalPolicy may bend these restrictions, however. For example, ContainerOrderFocusTraversalPolicy supports implicit down-cycle traversal.

        The alternative way to specify the traversal order of this Container's children is to make this Container a focus traversal policy provider.

        Parameters:
        focusCycleRoot - indicates whether this Container is the root of a focus traversal cycle
        Since:
        1.4
        See Also:
        Container.isFocusCycleRoot(), Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy), Container.getFocusTraversalPolicy(), ContainerOrderFocusTraversalPolicy, Container.setFocusTraversalPolicyProvider(boolean)
        Inherited member indicator setFocusTraversalKeys Reveal DetailHide Detail
        void setFocusTraversalKeys(int id, java.util.Set<? extends AWTKeyStroke> keystrokes)
        Sets the focus traversal keys for a given traversal operation for this Container.
        public void setFocusTraversalKeys(int id, java.util.Set<? extends AWTKeyStroke> keystrokes)
        Description copied from class: Container
        Sets the focus traversal keys for a given traversal operation for this Container.

        The default values for a Container's focus traversal keys are implementation-dependent. Sun recommends that all implementations for a particular native platform use the same default values. The recommendations for Windows and Unix are listed below. These recommendations are used in the Sun AWT implementations.

        Identifier Meaning Default
        KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS Normal forward keyboard traversal TAB on KEY_PRESSED, CTRL-TAB on KEY_PRESSED
        KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS Normal reverse keyboard traversal SHIFT-TAB on KEY_PRESSED, CTRL-SHIFT-TAB on KEY_PRESSED
        KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS Go up one focus traversal cycle none
        KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS Go down one focus traversal cycle none
        To disable a traversal key, use an empty Set; Collections.EMPTY_SET is recommended.

        Using the AWTKeyStroke API, client code can specify on which of two specific KeyEvents, KEY_PRESSED or KEY_RELEASED, the focus traversal operation will occur. Regardless of which KeyEvent is specified, however, all KeyEvents related to the focus traversal key, including the associated KEY_TYPED event, will be consumed, and will not be dispatched to any Container. It is a runtime error to specify a KEY_TYPED event as mapping to a focus traversal operation, or to map the same event to multiple default focus traversal operations.

        If a value of null is specified for the Set, this Container inherits the Set from its parent. If all ancestors of this Container have null specified for the Set, then the current KeyboardFocusManager's default Set is used.

        Overrides:
        setFocusTraversalKeys in class Component
        Parameters:
        id - one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
        keystrokes - the Set of AWTKeyStroke for the specified operation
        Throws:
        java.lang.IllegalArgumentException - if id is not one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS, or if keystrokes contains null, or if any Object in keystrokes is not an AWTKeyStroke, or if any keystroke represents a KEY_TYPED event, or if any keystroke already maps to another focus traversal operation for this Container
        Since:
        1.4
        See Also:
        Container.getFocusTraversalKeys(int), KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
        Inherited member indicator setFocusTraversalKeysEnabled Reveal DetailHide Detail
        void setFocusTraversalKeysEnabled(boolean focusTraversalKeysEnabled)
        Sets whether focus traversal keys are enabled for this Component.
        public void setFocusTraversalKeysEnabled(boolean focusTraversalKeysEnabled)
        Description copied from class: Component
        Sets whether focus traversal keys are enabled for this Component. Components for which focus traversal keys are disabled receive key events for focus traversal keys. Components for which focus traversal keys are enabled do not see these events; instead, the events are automatically converted to traversal operations.
        Parameters:
        focusTraversalKeysEnabled - whether focus traversal keys are enabled for this Component
        Since:
        1.4
        See Also:
        Component.getFocusTraversalKeysEnabled(), Component.setFocusTraversalKeys(int, java.util.Set<? extends java.awt.AWTKeyStroke>), Component.getFocusTraversalKeys(int)
        Inherited member indicator setFocusTraversalPolicy Reveal DetailHide Detail
        void setFocusTraversalPolicy(FocusTraversalPolicy policy)
        Sets the focus traversal policy that will manage keyboard traversal of this Container's children, if this Container is a focus cycle root.
        public void setFocusTraversalPolicy(FocusTraversalPolicy policy)
        Description copied from class: Container
        Sets the focus traversal policy that will manage keyboard traversal of this Container's children, if this Container is a focus cycle root. If the argument is null, this Container inherits its policy from its focus- cycle-root ancestor. If the argument is non-null, this policy will be inherited by all focus-cycle-root children that have no keyboard- traversal policy of their own (as will, recursively, their focus-cycle- root children).

        If this Container is not a focus cycle root, the policy will be remembered, but will not be used or inherited by this or any other Containers until this Container is made a focus cycle root.

        Parameters:
        policy - the new focus traversal policy for this Container
        Since:
        1.4
        See Also:
        Container.getFocusTraversalPolicy(), Container.setFocusCycleRoot(boolean), Container.isFocusCycleRoot(java.awt.Container)
        Inherited member indicator setFocusTraversalPolicyProvider Reveal DetailHide Detail
        void setFocusTraversalPolicyProvider(boolean provider)
        Sets whether this container will be used to provide focus traversal policy.
        public final void setFocusTraversalPolicyProvider(boolean provider)
        Description copied from class: Container
        Sets whether this container will be used to provide focus traversal policy. Container with this property as true will be used to acquire focus traversal policy instead of closest focus cycle root ancestor.
        Parameters:
        provider - indicates whether this container will be used to provide focus traversal policy
        Since:
        1.5
        See Also:
        Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy), Container.getFocusTraversalPolicy(), Container.isFocusTraversalPolicyProvider()
        Inherited member indicator transferFocus Reveal DetailHide Detail
        void transferFocus()
        Transfers the focus to the next component, as though this Component were the focus owner.
        public void transferFocus()
        Description copied from class: Component
        Transfers the focus to the next component, as though this Component were the focus owner.
        Since:
        JDK1.1
        See Also:
        Component.requestFocus()
        Inherited member indicator transferFocusBackward Reveal DetailHide Detail
        void transferFocusBackward()
        Transfers the focus to the previous component, as though this Component were the focus owner.
        public void transferFocusBackward()
        Description copied from class: Component
        Transfers the focus to the previous component, as though this Component were the focus owner.
        Since:
        1.4
        See Also:
        Component.requestFocus()
        Inherited member indicator transferFocusDownCycle Reveal DetailHide Detail
        void transferFocusDownCycle()
        Transfers the focus down one focus traversal cycle.
        public void transferFocusDownCycle()
        Description copied from class: Container
        Transfers the focus down one focus traversal cycle. If this Container is a focus cycle root, then the focus owner is set to this Container's default Component to focus, and the current focus cycle root is set to this Container. If this Container is not a focus cycle root, then no focus traversal operation occurs.
        Since:
        1.4
        See Also:
        Component.requestFocus(), Container.isFocusCycleRoot(java.awt.Container), Container.setFocusCycleRoot(boolean)
        Inherited member indicator transferFocusUpCycle Reveal DetailHide Detail
        void transferFocusUpCycle()
        Transfers the focus up one focus traversal cycle.
        public void transferFocusUpCycle()
        Description copied from class: Component
        Transfers the focus up one focus traversal cycle. Typically, the focus owner is set to this Component's focus cycle root, and the current focus cycle root is set to the new focus owner's focus cycle root. If, however, this Component's focus cycle root is a Window, then the focus owner is set to the focus cycle root's default Component to focus, and the current focus cycle root is unchanged.
        Since:
        1.4
        See Also:
        Component.requestFocus(), Container.isFocusCycleRoot(), Container.setFocusCycleRoot(boolean)
      • Graphics Methods 
        Modifier and Type Method and Description
        Inherited member indicator getFontMetrics Reveal DetailHide Detail
        FontMetrics getFontMetrics(Font font)
        Gets the font metrics for the specified font.
        public FontMetrics getFontMetrics(Font font)
        Description copied from class: Component
        Gets the font metrics for the specified font. Warning: Since Font metrics are affected by the FontRenderContext and this method does not provide one, it can return only metrics for the default render context which may not match that used when rendering on the Component if Graphics2D functionality is being used. Instead metrics can be obtained at rendering time by calling Graphics.getFontMetrics() or text measurement APIs on the Font class.
        Parameters:
        font - the font for which font metrics is to be obtained
        Returns:
        the font metrics for font
        Since:
        JDK1.0
        See Also:
        Component.getFont(), Component.getPeer(), ComponentPeer.getFontMetrics(Font), Toolkit.getFontMetrics(Font)
        Inherited member indicator getGraphics Reveal DetailHide Detail
        Graphics getGraphics()
        Creates a graphics context for this component.
        public Graphics getGraphics()
        Description copied from class: Component
        Creates a graphics context for this component. This method will return null if this component is currently not displayable.
        Returns:
        a graphics context for this component, or null if it has none
        Since:
        JDK1.0
        See Also:
        Component.paint(java.awt.Graphics)
        Inherited member indicator getGraphicsConfiguration Reveal DetailHide Detail
        GraphicsConfiguration getGraphicsConfiguration()
        Gets the GraphicsConfiguration associated with this Component.
        public GraphicsConfiguration getGraphicsConfiguration()
        Description copied from class: Component
        Gets the GraphicsConfiguration associated with this Component. If the Component has not been assigned a specific GraphicsConfiguration, the GraphicsConfiguration of the Component object's top-level container is returned. If the Component has been created, but not yet added to a Container, this method returns null.
        Returns:
        the GraphicsConfiguration used by this Component or null
        Since:
        1.3
        Inherited member indicator getLocationOnScreen Reveal DetailHide Detail
        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.
        public Point getLocationOnScreen()
        Description copied from class: Component
        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.
        Returns:
        an instance of Point representing the top-left corner of the component's bounds in the coordinate space of the screen
        Throws:
        IllegalComponentStateException - if the component is not showing on the screen
        See Also:
        Component.setLocation(int, int), Component.getLocation()
        Inherited member indicator getMousePosition Reveal DetailHide Detail
        Point getMousePosition()
        Returns the position of the mouse pointer in this Component's coordinate space if the Component is directly under the mouse pointer, otherwise returns null.
        public Point getMousePosition() throws HeadlessException
        Description copied from class: Component
        Returns the position of the mouse pointer in this Component's coordinate space if the Component is directly under the mouse pointer, otherwise returns null. If the Component is not showing on the screen, this method returns null even if the mouse pointer is above the area where the Component would be displayed. If the Component is partially or fully obscured by other Components or native windows, this method returns a non-null value only if the mouse pointer is located above the unobscured part of the Component.

        For Containers it returns a non-null value if the mouse is above the Container itself or above any of its descendants. Use Container.getMousePosition(boolean) if you need to exclude children.

        Sometimes the exact mouse coordinates are not important, and the only thing that matters is whether a specific Component is under the mouse pointer. If the return value of this method is null, mouse pointer is not directly above the Component.

        Returns:
        mouse coordinates relative to this Component, or null
        Throws:
        HeadlessException - if GraphicsEnvironment.isHeadless() returns true
        Since:
        1.5
        See Also:
        Component.isShowing(), Container.getMousePosition(boolean)
        Inherited member indicator getToolkit Reveal DetailHide Detail
        Toolkit getToolkit()
        Gets the toolkit of this component.
        public Toolkit getToolkit()
        Description copied from class: Component
        Gets the toolkit of this component. Note that the frame that contains a component controls which toolkit is used by that component. Therefore if the component is moved from one frame to another, the toolkit it uses may change.
        Returns:
        the toolkit of this component
        Since:
        JDK1.0
      • Hierarchy Methods 
        Modifier and Type Method and Description
        Inherited member indicator add Reveal DetailHide Detail
        Component add(Component comp)
        Appends the specified component to the end of this container.
        public Component add(Component comp)
        Description copied from class: Container
        Appends the specified component to the end of this container. This is a convenience method for Container.addImpl(java.awt.Component, java.lang.Object, int).

        This method changes layout-related information, and therefore, invalidates the component hierarchy. If the container has already been displayed, the hierarchy must be validated thereafter in order to display the added component.

        Parameters:
        comp - the component to be added
        Returns:
        the component argument
        Throws:
        java.lang.NullPointerException - if comp is null
        See Also:
        Container.addImpl(java.awt.Component, java.lang.Object, int), Container.invalidate(), Container.validate(), JComponent.revalidate()
        Inherited member indicator add Reveal DetailHide Detail
        Component add(Component comp, int index)
        Adds the specified component to this container at the given position.
        public Component add(Component comp, int index)
        Description copied from class: Container
        Adds the specified component to this container at the given position. This is a convenience method for Container.addImpl(java.awt.Component, java.lang.Object, int).

        This method changes layout-related information, and therefore, invalidates the component hierarchy. If the container has already been displayed, the hierarchy must be validated thereafter in order to display the added component.

        Parameters:
        comp - the component to be added
        index - the position at which to insert the component, or -1 to append the component to the end
        Returns:
        the component comp
        Throws:
        java.lang.NullPointerException - if comp is null
        java.lang.IllegalArgumentException - if index is invalid (see Container.addImpl(java.awt.Component, java.lang.Object, int) for details)
        See Also:
        Container.addImpl(java.awt.Component, java.lang.Object, int), Container.remove(int), Container.invalidate(), Container.validate(), JComponent.revalidate()
        Inherited member indicator add Reveal DetailHide Detail
        void add(Component comp, java.lang.Object constraints)
        Adds the specified component to the end of this container.
        public void add(Component comp, java.lang.Object constraints)
        Description copied from class: Container
        Adds the specified component to the end of this container. Also notifies the layout manager to add the component to this container's layout using the specified constraints object. This is a convenience method for Container.addImpl(java.awt.Component, java.lang.Object, int).

        This method changes layout-related information, and therefore, invalidates the component hierarchy. If the container has already been displayed, the hierarchy must be validated thereafter in order to display the added component.

        Parameters:
        comp - the component to be added
        constraints - an object expressing layout contraints for this component
        Throws:
        java.lang.NullPointerException - if comp is null
        Since:
        JDK1.1
        See Also:
        Container.addImpl(java.awt.Component, java.lang.Object, int), Container.invalidate(), Container.validate(), JComponent.revalidate(), LayoutManager
        Inherited member indicator add Reveal DetailHide Detail
        void add(Component comp, java.lang.Object constraints, int index)
        Adds the specified component to this container with the specified constraints at the specified index.
        public void add(Component comp, java.lang.Object constraints, int index)
        Description copied from class: Container
        Adds the specified component to this container with the specified constraints at the specified index. Also notifies the layout manager to add the component to the this container's layout using the specified constraints object. This is a convenience method for Container.addImpl(java.awt.Component, java.lang.Object, int).

        This method changes layout-related information, and therefore, invalidates the component hierarchy. If the container has already been displayed, the hierarchy must be validated thereafter in order to display the added component.

        Parameters:
        comp - the component to be added
        constraints - an object expressing layout contraints for this
        index - the position in the container's list at which to insert the component; -1 means insert at the end component
        Throws:
        java.lang.NullPointerException - if comp is null
        java.lang.IllegalArgumentException - if index is invalid (see Container.addImpl(java.awt.Component, java.lang.Object, int) for details)
        See Also:
        Container.addImpl(java.awt.Component, java.lang.Object, int), Container.invalidate(), Container.validate(), JComponent.revalidate(), Container.remove(int), LayoutManager
        Inherited member indicator add Reveal DetailHide Detail
        Component add(java.lang.String name, Component comp)
        Adds the specified component to this container.
        public Component add(java.lang.String name, Component comp)
        Description copied from class: Container
        Adds the specified component to this container. This is a convenience method for Container.addImpl(java.awt.Component, java.lang.Object, int).

        This method is obsolete as of 1.1. Please use the method add(Component, Object) instead.

        This method changes layout-related information, and therefore, invalidates the component hierarchy. If the container has already been displayed, the hierarchy must be validated thereafter in order to display the added component.

        Throws:
        java.lang.NullPointerException - if comp is null
        See Also:
        Container.add(Component, Object), Container.invalidate()
        Overridden member indicator addImpl Reveal DetailHide Detail
        protected void addImpl(Component comp, java.lang.Object constraints, int index)
        Adds the specified component to this scroll pane container.
        protected final void addImpl(Component comp, java.lang.Object constraints, int index)
        Adds the specified component to this scroll pane container. If the scroll pane has an existing child component, that component is removed and the new one is added.
        Overrides:
        addImpl in class Container
        Parameters:
        comp - the component to be added
        constraints - not applicable
        index - position of child component (must be <= 0)
        See Also:
        Container.add(Component), Container.add(Component, int), Container.add(Component, java.lang.Object), Container.invalidate(), LayoutManager, LayoutManager2
        Inherited member indicator countComponents Reveal DetailHide Detail
        int countComponents()
        Deprecated. As of JDK version 1.1, replaced by getComponentCount().
        @Deprecated public int countComponents()
        Deprecated. As of JDK version 1.1, replaced by getComponentCount().
        Inherited member indicator getComponent Reveal DetailHide Detail
        Component getComponent(int n)
        Gets the nth component in this container.
        public Component getComponent(int n)
        Description copied from class: Container
        Gets the nth component in this container.

        Note: This method should be called under AWT tree lock.

        Parameters:
        n - the index of the component to get.
        Returns:
        the nth component in this container.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - if the nth value does not exist.
        See Also:
        Component.getTreeLock()
        Inherited member indicator getComponentCount Reveal DetailHide Detail
        int getComponentCount()
        Gets the number of components in this panel.
        public int getComponentCount()
        Description copied from class: Container
        Gets the number of components in this panel.

        Note: This method should be called under AWT tree lock.

        Returns:
        the number of components in this panel.
        Since:
        JDK1.1
        See Also:
        Container.getComponent(int), Component.getTreeLock()
        Inherited member indicator getComponents Reveal DetailHide Detail
        Component[] getComponents()
        Gets all the components in this container.
        public Component[] getComponents()
        Description copied from class: Container
        Gets all the components in this container.

        Note: This method should be called under AWT tree lock.

        Returns:
        an array of all the components in this container.
        See Also:
        Component.getTreeLock()
        Inherited member indicator getComponentZOrder Reveal DetailHide Detail
        int getComponentZOrder(Component comp)
        Returns the z-order index of the component inside the container.
        public int getComponentZOrder(Component comp)
        Description copied from class: Container
        Returns the z-order index of the component inside the container. The higher a component is in the z-order hierarchy, the lower its index. The component with the lowest z-order index is painted last, above all other child components.
        Parameters:
        comp - the component being queried
        Returns:
        the z-order index of the component; otherwise returns -1 if the component is null or doesn't belong to the container
        Since:
        1.5
        See Also:
        Container.setComponentZOrder(java.awt.Component, int)
        Inherited member indicator isAncestorOf Reveal DetailHide Detail
        boolean isAncestorOf(Component c)
        Checks if the component is contained in the component hierarchy of this container.
        public boolean isAncestorOf(Component c)
        Description copied from class: Container
        Checks if the component is contained in the component hierarchy of this container.
        Parameters:
        c - the component
        Returns:
        true if it is an ancestor; false otherwise.
        Since:
        JDK1.1
        Inherited member indicator remove Reveal DetailHide Detail
        void remove(Component comp)
        Removes the specified component from this container.
        public void remove(Component comp)
        Description copied from class: Container
        Removes the specified component from this container. This method also notifies the layout manager to remove the component from this container's layout via the removeLayoutComponent method.

        This method changes layout-related information, and therefore, invalidates the component hierarchy. If the container has already been displayed, the hierarchy must be validated thereafter in order to reflect the changes.

        Parameters:
        comp - the component to be removed
        Throws:
        java.lang.NullPointerException - if comp is null
        See Also:
        Container.add(java.awt.Component), Container.invalidate(), Container.validate(), Container.remove(int)
        Inherited member indicator remove Reveal DetailHide Detail
        void remove(int index)
        Removes the component, specified by index, from this container.
        public void remove(int index)
        Description copied from class: Container
        Removes the component, specified by index, from this container. This method also notifies the layout manager to remove the component from this container's layout via the removeLayoutComponent method.

        This method changes layout-related information, and therefore, invalidates the component hierarchy. If the container has already been displayed, the hierarchy must be validated thereafter in order to reflect the changes.

        Parameters:
        index - the index of the component to be removed
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - if index is not in range [0, getComponentCount()-1]
        Since:
        JDK1.1
        See Also:
        Container.add(java.awt.Component), Container.invalidate(), Container.validate(), Container.getComponentCount()
        Inherited member indicator removeAll Reveal DetailHide Detail
        void removeAll()
        Removes all the components from this container.
        public void removeAll()
        Description copied from class: Container
        Removes all the components from this container. This method also notifies the layout manager to remove the components from this container's layout via the removeLayoutComponent method.

        This method changes layout-related information, and therefore, invalidates the component hierarchy. If the container has already been displayed, the hierarchy must be validated thereafter in order to reflect the changes.

        See Also:
        Container.add(java.awt.Component), Container.remove(int), Container.invalidate()
        Inherited member indicator setComponentZOrder Reveal DetailHide Detail
        void setComponentZOrder(Component comp, int index)
        Moves the specified component to the specified z-order index in the container.
        public void setComponentZOrder(Component comp, int index)
        Description copied from class: Container
        Moves the specified component to the specified z-order index in the container. The z-order determines the order that components are painted; the component with the highest z-order paints first and the component with the lowest z-order paints last. Where components overlap, the component with the lower z-order paints over the component with the higher z-order.

        If the component is a child of some other container, it is removed from that container before being added to this container. The important difference between this method and java.awt.Container.add(Component, int) is that this method doesn't call removeNotify on the component while removing it from its previous container unless necessary and when allowed by the underlying native windowing system. This way, if the component has the keyboard focus, it maintains the focus when moved to the new position.

        This property is guaranteed to apply only to lightweight non-Container components.

        This method changes layout-related information, and therefore, invalidates the component hierarchy.

        Note: Not all platforms support changing the z-order of heavyweight components from one container into another without the call to removeNotify. There is no way to detect whether a platform supports this, so developers shouldn't make any assumptions.

        Parameters:
        comp - the component to be moved
        index - the position in the container's list to insert the component, where getComponentCount() appends to the end
        Throws:
        java.lang.NullPointerException - if comp is null
        java.lang.IllegalArgumentException - if comp is one of the container's parents
        java.lang.IllegalArgumentException - if index is not in the range [0, getComponentCount()] for moving between containers, or not in the range [0, getComponentCount()-1] for moving inside a container
        java.lang.IllegalArgumentException - if adding a container to itself
        java.lang.IllegalArgumentException - if adding a Window to a container
        Since:
        1.5
        See Also:
        Container.getComponentZOrder(java.awt.Component), Container.invalidate()
      • Image Methods 
        Modifier and Type Method and Description
        Inherited member indicator checkImage Reveal DetailHide Detail
        int checkImage(Image image, java.awt.image.ImageObserver observer)
        Returns the status of the construction of a screen representation of the specified image.
        public int checkImage(Image image, java.awt.image.ImageObserver observer)
        Description copied from class: Component
        Returns the status of the construction of a screen representation of the specified image.

        This method does not cause the image to begin loading. An application must use the prepareImage method to force the loading of an image.

        Information on the flags returned by this method can be found with the discussion of the ImageObserver interface.

        Parameters:
        image - the Image object whose status is being checked
        observer - the ImageObserver object to be notified as the image is being prepared
        Returns:
        the bitwise inclusive OR of ImageObserver flags indicating what information about the image is currently available
        Since:
        JDK1.0
        See Also:
        Component.prepareImage(Image, int, int, java.awt.image.ImageObserver), Toolkit.checkImage(Image, int, int, java.awt.image.ImageObserver), ImageObserver
        Inherited member indicator checkImage Reveal DetailHide Detail
        int checkImage(Image image, int width, int height, java.awt.image.ImageObserver observer)
        Returns the status of the construction of a screen representation of the specified image.
        public int checkImage(Image image, int width, int height, java.awt.image.ImageObserver observer)
        Description copied from class: Component
        Returns the status of the construction of a screen representation of the specified image.

        This method does not cause the image to begin loading. An application must use the prepareImage method to force the loading of an image.

        The checkImage method of Component calls its peer's checkImage method to calculate the flags. If this component does not yet have a peer, the component's toolkit's checkImage method is called instead.

        Information on the flags returned by this method can be found with the discussion of the ImageObserver interface.

        Parameters:
        image - the Image object whose status is being checked
        width - the width of the scaled version whose status is to be checked
        height - the height of the scaled version whose status is to be checked
        observer - the ImageObserver object to be notified as the image is being prepared
        Returns:
        the bitwise inclusive OR of ImageObserver flags indicating what information about the image is currently available
        Since:
        JDK1.0
        See Also:
        Component.prepareImage(Image, int, int, java.awt.image.ImageObserver), Toolkit.checkImage(Image, int, int, java.awt.image.ImageObserver), ImageObserver
        Inherited member indicator createImage Reveal DetailHide Detail
        Image createImage(java.awt.image.ImageProducer producer)
        Creates an image from the specified image producer.
        public Image createImage(java.awt.image.ImageProducer producer)
        Description copied from class: Component
        Creates an image from the specified image producer.
        Parameters:
        producer - the image producer
        Returns:
        the image produced
        Since:
        JDK1.0
        Inherited member indicator createImage Reveal DetailHide Detail
        Image createImage(int width, int height)
        Creates an off-screen drawable image to be used for double buffering.
        public Image createImage(int width, int height)
        Description copied from class: Component
        Creates an off-screen drawable image to be used for double buffering.
        Parameters:
        width - the specified width
        height - the specified height
        Returns:
        an off-screen drawable image, which can be used for double buffering. The return value may be null if the component is not displayable. This will always happen if GraphicsEnvironment.isHeadless() returns true.
        Since:
        JDK1.0
        See Also:
        Component.isDisplayable(), GraphicsEnvironment.isHeadless()
        Inherited member indicator createVolatileImage Reveal DetailHide Detail
        java.awt.image.VolatileImage createVolatileImage(int width, int height)
        Creates a volatile off-screen drawable image to be used for double buffering.
        public java.awt.image.VolatileImage createVolatileImage(int width, int height)
        Description copied from class: Component
        Creates a volatile off-screen drawable image to be used for double buffering.
        Parameters:
        width - the specified width.
        height - the specified height.
        Returns:
        an off-screen drawable image, which can be used for double buffering. The return value may be null if the component is not displayable. This will always happen if GraphicsEnvironment.isHeadless() returns true.
        Since:
        1.4
        See Also:
        VolatileImage, Component.isDisplayable(), GraphicsEnvironment.isHeadless()
        Inherited member indicator createVolatileImage Reveal DetailHide Detail
        java.awt.image.VolatileImage createVolatileImage(int width, int height, ImageCapabilities caps)
        Creates a volatile off-screen drawable image, with the given capabilities.
        public java.awt.image.VolatileImage createVolatileImage(int width, int height, ImageCapabilities caps) throws AWTException
        Description copied from class: Component
        Creates a volatile off-screen drawable image, with the given capabilities. The contents of this image may be lost at any time due to operating system issues, so the image must be managed via the VolatileImage interface.
        Parameters:
        width - the specified width.
        height - the specified height.
        caps - the image capabilities
        Returns:
        a VolatileImage object, which can be used to manage surface contents loss and capabilities.
        Throws:
        AWTException - if an image with the specified capabilities cannot be created
        Since:
        1.4
        See Also:
        VolatileImage
        Inherited member indicator imageUpdate Reveal DetailHide Detail
        boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h)
        Repaints the component when the image has changed.
        public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h)
        Description copied from class: Component
        Repaints the component when the image has changed. This imageUpdate method of an ImageObserver is called when more information about an image which had been previously requested using an asynchronous routine such as the drawImage method of Graphics becomes available. See the definition of imageUpdate for more information on this method and its arguments.

        The imageUpdate method of Component incrementally draws an image on the component as more of the bits of the image are available.

        If the system property awt.image.incrementaldraw is missing or has the value true, the image is incrementally drawn. If the system property has any other value, then the image is not drawn until it has been completely loaded.

        Also, if incremental drawing is in effect, the value of the system property awt.image.redrawrate is interpreted as an integer to give the maximum redraw rate, in milliseconds. If the system property is missing or cannot be interpreted as an integer, the redraw rate is once every 100ms.

        The interpretation of the x, y, width, and height arguments depends on the value of the infoflags argument.

        Specified by:
        imageUpdate in interface java.awt.image.ImageObserver
        Parameters:
        img - the image being observed
        infoflags - see imageUpdate for more information
        x - the x coordinate
        y - the y coordinate
        w - the width
        h - the height
        Returns:
        false if the infoflags indicate that the image is completely loaded; true otherwise.
        Since:
        JDK1.0
        See Also:
        ImageObserver, Graphics.drawImage(Image, int, int, Color, java.awt.image.ImageObserver), Graphics.drawImage(Image, int, int, java.awt.image.ImageObserver), Graphics.drawImage(Image, int, int, int, int, Color, java.awt.image.ImageObserver), Graphics.drawImage(Image, int, int, int, int, java.awt.image.ImageObserver), ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int)
        Inherited member indicator prepareImage Reveal DetailHide Detail
        boolean prepareImage(Image image, java.awt.image.ImageObserver observer)
        Prepares an image for rendering on this component.
        public boolean prepareImage(Image image, java.awt.image.ImageObserver observer)
        Description copied from class: Component
        Prepares an image for rendering on this component. The image data is downloaded asynchronously in another thread and the appropriate screen representation of the image is generated.
        Parameters:
        image - the Image for which to prepare a screen representation
        observer - the ImageObserver object to be notified as the image is being prepared
        Returns:
        true if the image has already been fully prepared; false otherwise
        Since:
        JDK1.0
        Inherited member indicator prepareImage Reveal DetailHide Detail
        boolean prepareImage(Image image, int width, int height, java.awt.image.ImageObserver observer)
        Prepares an image for rendering on this component at the specified width and height.
        public boolean prepareImage(Image image, int width, int height, java.awt.image.ImageObserver observer)
        Description copied from class: Component
        Prepares an image for rendering on this component at the specified width and height.

        The image data is downloaded asynchronously in another thread, and an appropriately scaled screen representation of the image is generated.

        Parameters:
        image - the instance of Image for which to prepare a screen representation
        width - the width of the desired screen representation
        height - the height of the desired screen representation
        observer - the ImageObserver object to be notified as the image is being prepared
        Returns:
        true if the image has already been fully prepared; false otherwise
        Since:
        JDK1.0
        See Also:
        ImageObserver
      • Layout Methods 
        Modifier and Type Method and Description
        Inherited member indicator bounds Reveal DetailHide Detail
        Rectangle bounds()
        Deprecated. As of JDK version 1.1, replaced by getBounds().
        @Deprecated public Rectangle bounds()
        Deprecated. As of JDK version 1.1, replaced by getBounds().
        Inherited member indicator contains Reveal DetailHide Detail
        boolean contains(int x, int y)
        Checks whether this component "contains" the specified point, where x and y are defined to be relative to the coordinate system of this component.
        public boolean contains(int x, int y)
        Description copied from class: Component
        Checks whether this component "contains" the specified point, where x and y are defined to be relative to the coordinate system of this component.
        Parameters:
        x - the x coordinate of the point
        y - the y coordinate of the point
        Since:
        JDK1.1
        See Also:
        Component.getComponentAt(int, int)
        Inherited member indicator contains Reveal DetailHide Detail
        boolean contains(Point p)
        Checks whether this component "contains" the specified point, where the point's x and y coordinates are defined to be relative to the coordinate system of this component.
        public boolean contains(Point p)
        Description copied from class: Component
        Checks whether this component "contains" the specified point, where the point's x and y coordinates are defined to be relative to the coordinate system of this component.
        Parameters:
        p - the point
        Throws:
        java.lang.NullPointerException - if p is null
        Since:
        JDK1.1
        See Also:
        Component.getComponentAt(Point)
        Overridden member indicator doLayout Reveal DetailHide Detail
        void doLayout()
        Lays out this container by resizing its child to its preferred size.
        public void doLayout()
        Lays out this container by resizing its child to its preferred size. If the new preferred size of the child causes the current scroll position to be invalid, the scroll position is set to the closest valid position.
        Overrides:
        doLayout in class Container
        See Also:
        Component.validate()
        Inherited member indicator findComponentAt Reveal DetailHide Detail
        Component findComponentAt(int x, int y)
        Locates the visible child component that contains the specified position.
        public Component findComponentAt(int x, int y)
        Description copied from class: Container
        Locates the visible child component that contains the specified position. The top-most child component is returned in the case where there is overlap in the components. If the containing child component is a Container, this method will continue searching for the deepest nested child component. Components which are not visible are ignored during the search.

        The findComponentAt method is different from getComponentAt in that getComponentAt only searches the Container's immediate children; if the containing component is a Container, findComponentAt will search that child to find a nested component.

        Parameters:
        x - the x coordinate
        y - the y coordinate
        Returns:
        null if the component does not contain the position. If there is no child component at the requested point and the point is within the bounds of the container the container itself is returned.
        Since:
        1.2
        See Also:
        Component.contains(int, int), Container.getComponentAt(int, int)
        Inherited member indicator findComponentAt Reveal DetailHide Detail
        Component findComponentAt(Point p)
        Locates the visible child component that contains the specified point.
        public Component findComponentAt(Point p)
        Description copied from class: Container
        Locates the visible child component that contains the specified point. The top-most child component is returned in the case where there is overlap in the components. If the containing child component is a Container, this method will continue searching for the deepest nested child component. Components which are not visible are ignored during the search.

        The findComponentAt method is different from getComponentAt in that getComponentAt only searches the Container's immediate children; if the containing component is a Container, findComponentAt will search that child to find a nested component.

        Parameters:
        p - the point.
        Returns:
        null if the component does not contain the position. If there is no child component at the requested point and the point is within the bounds of the container the container itself is returned.
        Throws:
        java.lang.NullPointerException - if p is null
        Since:
        1.2
        See Also:
        Component.contains(int, int), Container.getComponentAt(int, int)
        Inherited member indicator getAlignmentX Reveal DetailHide Detail
        float getAlignmentX()
        Returns the alignment along the x axis.
        public float getAlignmentX()
        Description copied from class: Container
        Returns the alignment along the x axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.
        Overrides:
        getAlignmentX in class Component
        Inherited member indicator getAlignmentY Reveal DetailHide Detail
        float getAlignmentY()
        Returns the alignment along the y axis.
        public float getAlignmentY()
        Description copied from class: Container
        Returns the alignment along the y axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.
        Overrides:
        getAlignmentY in class Component
        Inherited member indicator getBaseline Reveal DetailHide Detail
        int getBaseline(int width, int height)
        Returns the baseline.
        public int getBaseline(int width, int height)
        Description copied from class: Component
        Returns the baseline. The baseline is measured from the top of the component. This method is primarily meant for LayoutManagers to align components along their baseline. A return value less than 0 indicates this component does not have a reasonable baseline and that LayoutManagers should not align this component on its baseline.

        The default implementation returns -1. Subclasses that support baseline should override appropriately. If a value >= 0 is returned, then the component has a valid baseline for any size >= the minimum size and getBaselineResizeBehavior can be used to determine how the baseline changes with size.

        Parameters:
        width - the width to get the baseline for
        height - the height to get the baseline for
        Returns:
        the baseline or < 0 indicating there is no reasonable baseline
        Throws:
        java.lang.IllegalArgumentException - if width or height is < 0
        Since:
        1.6
        See Also:
        Component.getBaselineResizeBehavior(), FontMetrics
        Inherited member indicator getBaselineResizeBehavior Reveal DetailHide Detail
        Component.BaselineResizeBehavior getBaselineResizeBehavior()
        Returns an enum indicating how the baseline of the component changes as the size changes.
        public Component.BaselineResizeBehavior getBaselineResizeBehavior()
        Description copied from class: Component
        Returns an enum indicating how the baseline of the component changes as the size changes. This method is primarily meant for layout managers and GUI builders.

        The default implementation returns BaselineResizeBehavior.OTHER. Subclasses that have a baseline should override appropriately. Subclasses should never return null; if the baseline can not be calculated return BaselineResizeBehavior.OTHER. Callers should first ask for the baseline using getBaseline and if a value >= 0 is returned use this method. It is acceptable for this method to return a value other than BaselineResizeBehavior.OTHER even if getBaseline returns a value less than 0.

        Returns:
        an enum indicating how the baseline changes as the component size changes
        Since:
        1.6
        See Also:
        Component.getBaseline(int, int)
        Inherited member indicator getBounds Reveal DetailHide Detail
        Rectangle getBounds()
        Gets the bounds of this component in the form of a Rectangle object.
        public Rectangle getBounds()
        Description copied from class: Component
        Gets the bounds of this component in the form of a Rectangle object. The bounds specify this component's width, height, and location relative to its parent.
        Returns:
        a rectangle indicating this component's bounds
        See Also:
        Component.setBounds(int, int, int, int), Component.getLocation(), Component.getSize()
        Inherited member indicator getBounds Reveal DetailHide Detail
        Rectangle getBounds(Rectangle rv)
        Stores the bounds of this component into "return value" rv and return rv.
        public Rectangle getBounds(Rectangle rv)
        Description copied from class: Component
        Stores the bounds of this component into "return value" rv and return rv. If rv is null a new Rectangle is allocated. This version of getBounds is useful if the caller wants to avoid allocating a new Rectangle object on the heap.
        Parameters:
        rv - the return value, modified to the components bounds
        Returns:
        rv
        Inherited member indicator getComponentAt Reveal DetailHide Detail
        Component getComponentAt(int x, int y)
        Locates the component that contains the x,y position.
        public Component getComponentAt(int x, int y)
        Description copied from class: Container
        Locates the component that contains the x,y position. The top-most child component is returned in the case where there is overlap in the components. This is determined by finding the component closest to the index 0 that claims to contain the given point via Component.contains(), except that Components which have native peers take precedence over those which do not (i.e., lightweight Components).
        Overrides:
        getComponentAt in class Component
        Parameters:
        x - the x coordinate
        y - the y coordinate
        Returns:
        null if the component does not contain the position. If there is no child component at the requested point and the point is within the bounds of the container the container itself is returned; otherwise the top-most child is returned.
        Since:
        JDK1.1
        See Also:
        Component.contains(int, int)
        Inherited member indicator getComponentAt Reveal DetailHide Detail
        Component getComponentAt(Point p)
        Gets the component that contains the specified point.
        public Component getComponentAt(Point p)
        Description copied from class: Container
        Gets the component that contains the specified point.
        Overrides:
        getComponentAt in class Component
        Parameters:
        p - the point.
        Returns:
        returns the component that contains the point, or null if the component does not contain the point.
        Since:
        JDK1.1
        See Also:
        Component.contains(int, int)
        Inherited member indicator getHeight Reveal DetailHide Detail
        int getHeight()
        Returns the current height of this component.
        public int getHeight()
        Description copied from class: Component
        Returns the current height of this component. This method is preferable to writing component.getBounds().height, or component.getSize().height because it doesn't cause any heap allocations.
        Returns:
        the current height of this component
        Since:
        1.2
        Inherited member indicator getInsets Reveal DetailHide Detail
        Insets getInsets()
        Determines the insets of this container, which indicate the size of the container's border.
        public Insets getInsets()
        Description copied from class: Container
        Determines the insets of this container, which indicate the size of the container's border.

        A Frame object, for example, has a top inset that corresponds to the height of the frame's title bar.

        Returns:
        the insets of this container.
        Since:
        JDK1.1
        See Also:
        Insets, LayoutManager
        Inherited member indicator getLayout Reveal DetailHide Detail
        LayoutManager getLayout()
        Gets the layout manager for this container.
        public LayoutManager getLayout()
        Description copied from class: Container
        Gets the layout manager for this container.
        See Also:
        Container.doLayout(), Container.setLayout(java.awt.LayoutManager)
        Inherited member indicator getLocation Reveal DetailHide Detail
        Point getLocation()
        Gets the location of this component in the form of a point specifying the component's top-left corner.
        public Point getLocation()
        Description copied from class: Component
        Gets the location of this component in the form of a point specifying the component's top-left corner. The location will be relative to the parent's coordinate space.

        Due to the asynchronous nature of native event handling, this method can return outdated values (for instance, after several calls of setLocation() in rapid succession). For this reason, the recommended method of obtaining a component's position is within java.awt.event.ComponentListener.componentMoved(), which is called after the operating system has finished moving the component.

        Returns:
        an instance of Point representing the top-left corner of the component's bounds in the coordinate space of the component's parent
        Since:
        JDK1.1
        See Also:
        Component.setLocation(int, int), Component.getLocationOnScreen()
        Inherited member indicator getLocation Reveal DetailHide Detail
        Point getLocation(Point rv)
        Stores the x,y origin of this component into "return value" rv and return rv.
        public Point getLocation(Point rv)
        Description copied from class: Component
        Stores the x,y origin of this component into "return value" rv and return rv. If rv is null a new Point is allocated. This version of getLocation is useful if the caller wants to avoid allocating a new Point object on the heap.
        Parameters:
        rv - the return value, modified to the components location
        Returns:
        rv
        Inherited member indicator getMaximumSize Reveal DetailHide Detail
        Dimension getMaximumSize()
        Returns the maximum size of this container.
        public Dimension getMaximumSize()
        Description copied from class: Container
        Returns the maximum size of this container. If the maximum size has not been set explicitly by Component.setMaximumSize(Dimension) and the LayoutManager installed on this Container is an instance of LayoutManager2, then LayoutManager2.maximumLayoutSize(Container) is used to calculate the maximum size.

        Note: some implementations may cache the value returned from the LayoutManager2. Implementations that cache need not invoke maximumLayoutSize on the LayoutManager2 every time this method is invoked, rather the LayoutManager2 will only be queried after the Container becomes invalid.

        Overrides:
        getMaximumSize in class Component
        Returns:
        an instance of Dimension that represents the maximum size of this container.
        See Also:
        Container.getPreferredSize(), Container.getMinimumSize(), Container.getLayout(), LayoutManager2.maximumLayoutSize(Container), Component.getMaximumSize()
        Inherited member indicator getMinimumSize Reveal DetailHide Detail
        Dimension getMinimumSize()
        Returns the minimum size of this container.
        public Dimension getMinimumSize()
        Description copied from class: Container
        Returns the minimum size of this container. If the minimum size has not been set explicitly by Component.setMinimumSize(Dimension) and this Container has a non-null LayoutManager, then LayoutManager.minimumLayoutSize(Container) is used to calculate the minimum size.

        Note: some implementations may cache the value returned from the LayoutManager. Implementations that cache need not invoke minimumLayoutSize on the LayoutManager every time this method is invoked, rather the LayoutManager will only be queried after the Container becomes invalid.

        Overrides:
        getMinimumSize in class Component
        Returns:
        an instance of Dimension that represents the minimum size of this container.
        Since:
        JDK1.1
        See Also:
        Container.getPreferredSize(), Container.getMaximumSize(), Container.getLayout(), LayoutManager.minimumLayoutSize(Container), Component.getMinimumSize()
        Inherited member indicator getMousePosition Reveal DetailHide Detail
        Point getMousePosition(boolean allowChildren)
        Returns the position of the mouse pointer in this Container's coordinate space if the Container is under the mouse pointer, otherwise returns null.
        public Point getMousePosition(boolean allowChildren) throws HeadlessException
        Description copied from class: Container
        Returns the position of the mouse pointer in this Container's coordinate space if the Container is under the mouse pointer, otherwise returns null. This method is similar to Component.getMousePosition() with the exception that it can take the Container's children into account. If allowChildren is false, this method will return a non-null value only if the mouse pointer is above the Container directly, not above the part obscured by children. If allowChildren is true, this method returns a non-null value if the mouse pointer is above Container or any of its descendants.
        Parameters:
        allowChildren - true if children should be taken into account
        Returns:
        mouse coordinates relative to this Component, or null
        Throws:
        HeadlessException - if GraphicsEnvironment.isHeadless() returns true
        Since:
        1.5
        See Also:
        Component.getMousePosition()
        Inherited member indicator getPreferredSize Reveal DetailHide Detail
        Dimension getPreferredSize()
        Returns the preferred size of this container.
        public Dimension getPreferredSize()
        Description copied from class: Container
        Returns the preferred size of this container. If the preferred size has not been set explicitly by Component.setPreferredSize(Dimension) and this Container has a non-null LayoutManager, then LayoutManager.preferredLayoutSize(Container) is used to calculate the preferred size.

        Note: some implementations may cache the value returned from the LayoutManager. Implementations that cache need not invoke preferredLayoutSize on the LayoutManager every time this method is invoked, rather the LayoutManager will only be queried after the Container becomes invalid.

        Overrides:
        getPreferredSize in class Component
        Returns:
        an instance of Dimension that represents the preferred size of this container.
        See Also:
        Container.getMinimumSize(), Container.getMaximumSize(), Container.getLayout(), LayoutManager.preferredLayoutSize(Container), Component.getPreferredSize()
        Inherited member indicator getSize Reveal DetailHide Detail
        Dimension getSize()
        Returns the size of this component in the form of a Dimension object.
        public Dimension getSize()
        Description copied from class: Component
        Returns the size of this component in the form of a Dimension object. The height field of the Dimension object contains this component's height, and the width field of the Dimension object contains this component's width.
        Returns:
        a Dimension object that indicates the size of this component
        Since:
        JDK1.1
        See Also:
        Component.setSize(int, int)
        Inherited member indicator getSize Reveal DetailHide Detail
        Dimension getSize(Dimension rv)
        Stores the width/height of this component into "return value" rv and return rv.
        public Dimension getSize(Dimension rv)
        Description copied from class: Component
        Stores the width/height of this component into "return value" rv and return rv. If rv is null a new Dimension object is allocated. This version of getSize is useful if the caller wants to avoid allocating a new Dimension object on the heap.
        Parameters:
        rv - the return value, modified to the components size
        Returns:
        rv
        Inherited member indicator getWidth Reveal DetailHide Detail
        int getWidth()
        Returns the current width of this component.
        public int getWidth()
        Description copied from class: Component
        Returns the current width of this component. This method is preferable to writing component.getBounds().width, or component.getSize().width because it doesn't cause any heap allocations.
        Returns:
        the current width of this component
        Since:
        1.2
        Inherited member indicator getX Reveal DetailHide Detail
        int getX()
        Returns the current x coordinate of the components origin.
        public int getX()
        Description copied from class: Component
        Returns the current x coordinate of the components origin. This method is preferable to writing component.getBounds().x, or component.getLocation().x because it doesn't cause any heap allocations.
        Returns:
        the current x coordinate of the components origin
        Since:
        1.2
        Inherited member indicator getY Reveal DetailHide Detail
        int getY()
        Returns the current y coordinate of the components origin.
        public int getY()
        Description copied from class: Component
        Returns the current y coordinate of the components origin. This method is preferable to writing component.getBounds().y, or component.getLocation().y because it doesn't cause any heap allocations.
        Returns:
        the current y coordinate of the components origin
        Since:
        1.2
        Inherited member indicator insets Reveal DetailHide Detail
        Insets insets()
        Deprecated. As of JDK version 1.1, replaced by getInsets().
        @Deprecated public Insets insets()
        Deprecated. As of JDK version 1.1, replaced by getInsets().
        Inherited member indicator inside Reveal DetailHide Detail
        boolean inside(int x, int y)
        Deprecated. As of JDK version 1.1, replaced by contains(int, int).
        @Deprecated public boolean inside(int x, int y)
        Deprecated. As of JDK version 1.1, replaced by contains(int, int).
        Inherited member indicator invalidate Reveal DetailHide Detail
        void invalidate()
        Invalidates the container.
        public void invalidate()
        Description copied from class: Container
        Invalidates the container.

        If the LayoutManager installed on this container is an instance of the LayoutManager2 interface, then the LayoutManager2.invalidateLayout(Container) method is invoked on it supplying this Container as the argument.

        Afterwards this method marks this container invalid, and invalidates its ancestors. See the Component.invalidate() method for more details.

        Overrides:
        invalidate in class Component
        See Also:
        Container.validate(), Container.layout(), LayoutManager2
        Inherited member indicator isMaximumSizeSet Reveal DetailHide Detail
        boolean isMaximumSizeSet()
        Returns true if the maximum size has been set to a non-null value otherwise returns false.
        public boolean isMaximumSizeSet()
        Description copied from class: Component
        Returns true if the maximum size has been set to a non-null value otherwise returns false.
        Returns:
        true if maximumSize is non-null, false otherwise
        Since:
        1.5
        Inherited member indicator isMinimumSizeSet Reveal DetailHide Detail
        boolean isMinimumSizeSet()
        Returns whether or not setMinimumSize has been invoked with a non-null value.
        public boolean isMinimumSizeSet()
        Description copied from class: Component
        Returns whether or not setMinimumSize has been invoked with a non-null value.
        Returns:
        true if setMinimumSize has been invoked with a non-null value.
        Since:
        1.5
        Inherited member indicator isPreferredSizeSet Reveal DetailHide Detail
        boolean isPreferredSizeSet()
        Returns true if the preferred size has been set to a non-null value otherwise returns false.
        public boolean isPreferredSizeSet()
        Description copied from class: Component
        Returns true if the preferred size has been set to a non-null value otherwise returns false.
        Returns:
        true if setPreferredSize has been invoked with a non-null value.
        Since:
        1.5
        Inherited member indicator isValid Reveal DetailHide Detail
        boolean isValid()
        Determines whether this component is valid.
        public boolean isValid()
        Description copied from class: Component
        Determines whether this component is valid. A component is valid when it is correctly sized and positioned within its parent container and all its children are also valid. In order to account for peers' size requirements, components are invalidated before they are first shown on the screen. By the time the parent container is fully realized, all its components will be valid.
        Returns:
        true if the component is valid, false otherwise
        Since:
        JDK1.0
        See Also:
        Component.validate(), Component.invalidate()
        Inherited member indicator isValidateRoot Reveal DetailHide Detail
        boolean isValidateRoot()
        Indicates if this container is a validate root.
        public boolean isValidateRoot()
        Description copied from class: Container
        Indicates if this container is a validate root.

        Layout-related changes, such as bounds of the validate root descendants, do not affect the layout of the validate root parent. This peculiarity enables the invalidate() method to stop invalidating the component hierarchy when the method encounters a validate root. However, to preserve backward compatibility this new optimized behavior is enabled only when the java.awt.smartInvalidate system property value is set to true.

        If a component hierarchy contains validate roots and the new optimized invalidate() behavior is enabled, the validate() method must be invoked on the validate root of a previously invalidated component to restore the validity of the hierarchy later. Otherwise, calling the validate() method on the top-level container (such as a Frame object) should be used to restore the validity of the component hierarchy.

        The Window class and the Applet class are the validate roots in AWT. Swing introduces more validate roots.

        Returns:
        whether this container is a validate root
        Since:
        1.7
        See Also:
        Container.invalidate(), Component.invalidate(), JComponent.isValidateRoot(), JComponent.revalidate()
        Overridden member indicator layout Reveal DetailHide Detail
        void layout()
        Deprecated. As of JDK version 1.1, replaced by doLayout().
        @Deprecated public void layout()
        Deprecated. As of JDK version 1.1, replaced by doLayout().
        Inherited member indicator locate Reveal DetailHide Detail
        Component locate(int x, int y)
        Deprecated. As of JDK version 1.1, replaced by getComponentAt(int, int).
        @Deprecated public Component locate(int x, int y)
        Deprecated. As of JDK version 1.1, replaced by getComponentAt(int, int).
        Inherited member indicator location Reveal DetailHide Detail
        Point location()
        Deprecated. As of JDK version 1.1, replaced by getLocation().
        @Deprecated public Point location()
        Deprecated. As of JDK version 1.1, replaced by getLocation().
        Inherited member indicator minimumSize Reveal DetailHide Detail
        Dimension minimumSize()
        Deprecated. As of JDK version 1.1, replaced by getMinimumSize().
        @Deprecated public Dimension minimumSize()
        Deprecated. As of JDK version 1.1, replaced by getMinimumSize().
        Inherited member indicator move Reveal DetailHide Detail
        void move(int x, int y)
        Deprecated. As of JDK version 1.1, replaced by setLocation(int, int).
        @Deprecated public void move(int x, int y)
        Deprecated. As of JDK version 1.1, replaced by setLocation(int, int).
        Inherited member indicator preferredSize Reveal DetailHide Detail
        Dimension preferredSize()
        Deprecated. As of JDK version 1.1, replaced by getPreferredSize().
        @Deprecated public Dimension preferredSize()
        Deprecated. As of JDK version 1.1, replaced by getPreferredSize().
        Inherited member indicator reshape Reveal DetailHide Detail
        void reshape(int x, int y, int width, int height)
        Deprecated. As of JDK version 1.1, replaced by setBounds(int, int, int, int).
        @Deprecated public void reshape(int x, int y, int width, int height)
        Deprecated. As of JDK version 1.1, replaced by setBounds(int, int, int, int).
        Inherited member indicator resize Reveal DetailHide Detail
        void resize(Dimension d)
        Deprecated. As of JDK version 1.1, replaced by setSize(Dimension).
        @Deprecated public void resize(Dimension d)
        Deprecated. As of JDK version 1.1, replaced by setSize(Dimension).
        Inherited member indicator resize Reveal DetailHide Detail
        void resize(int width, int height)
        Deprecated. As of JDK version 1.1, replaced by setSize(int, int).
        @Deprecated public void resize(int width, int height)
        Deprecated. As of JDK version 1.1, replaced by setSize(int, int).
        Inherited member indicator revalidate Reveal DetailHide Detail
        void revalidate()
        Revalidates the component hierarchy up to the nearest validate root.
        public void revalidate()
        Description copied from class: Component
        Revalidates the component hierarchy up to the nearest validate root.

        This method first invalidates the component hierarchy starting from this component up to the nearest validate root. Afterwards, the component hierarchy is validated starting from the nearest validate root.

        This is a convenience method supposed to help application developers avoid looking for validate roots manually. Basically, it's equivalent to first calling the Component.invalidate() method on this component, and then calling the Component.validate() method on the nearest validate root.

        Since:
        1.7
        See Also:
        Container.isValidateRoot()
        Inherited member indicator setBounds Reveal DetailHide Detail
        void setBounds(int x, int y, int width, int height)
        Moves and resizes this component.
        public void setBounds(int x, int y, int width, int height)
        Description copied from class: Component
        Moves and resizes this component. The new location of the top-left corner is specified by x and y, and the new size is specified by width and height.

        This method changes layout-related information, and therefore, invalidates the component hierarchy.

        Parameters:
        x - the new x-coordinate of this component
        y - the new y-coordinate of this component
        width - the new width of this component
        height - the new height of this component
        Since:
        JDK1.1
        See Also:
        Component.getBounds(), Component.setLocation(int, int), Component.setLocation(Point), Component.setSize(int, int), Component.setSize(Dimension), Component.invalidate()
        Inherited member indicator setBounds Reveal DetailHide Detail
        void setBounds(Rectangle r)
        Moves and resizes this component to conform to the new bounding rectangle r.
        public void setBounds(Rectangle r)
        Description copied from class: Component
        Moves and resizes this component to conform to the new bounding rectangle r. This component's new position is specified by r.x and r.y, and its new size is specified by r.width and r.height

        This method changes layout-related information, and therefore, invalidates the component hierarchy.

        Parameters:
        r - the new bounding rectangle for this component
        Throws:
        java.lang.NullPointerException - if r is null
        Since:
        JDK1.1
        See Also:
        Component.getBounds(), Component.setLocation(int, int), Component.setLocation(Point), Component.setSize(int, int), Component.setSize(Dimension), Component.invalidate()
        Overridden member indicator setLayout Reveal DetailHide Detail
        void setLayout(LayoutManager mgr)
        Sets the layout manager for this container.
        public final void setLayout(LayoutManager mgr)
        Sets the layout manager for this container. This method is overridden to prevent the layout mgr from being set.
        Overrides:
        setLayout in class Container
        Parameters:
        mgr - the specified layout manager
        See Also:
        Container.doLayout(), Container.getLayout(), Container.invalidate()
        Inherited member indicator setLocation Reveal DetailHide Detail
        void setLocation(int x, int y)
        Moves this component to a new location.
        public void setLocation(int x, int y)
        Description copied from class: Component
        Moves this component to a new location. The top-left corner of the new location is specified by the x and y parameters in the coordinate space of this component's parent.

        This method changes layout-related information, and therefore, invalidates the component hierarchy.

        Parameters:
        x - the x-coordinate of the new location's top-left corner in the parent's coordinate space
        y - the y-coordinate of the new location's top-left corner in the parent's coordinate space
        Since:
        JDK1.1
        See Also:
        Component.getLocation(), Component.setBounds(int, int, int, int), Component.invalidate()
        Inherited member indicator setLocation Reveal DetailHide Detail
        void setLocation(Point p)
        Moves this component to a new location.
        public void setLocation(Point p)
        Description copied from class: Component
        Moves this component to a new location. The top-left corner of the new location is specified by point p. Point p is given in the parent's coordinate space.

        This method changes layout-related information, and therefore, invalidates the component hierarchy.

        Parameters:
        p - the point defining the top-left corner of the new location, given in the coordinate space of this component's parent
        Since:
        JDK1.1
        See Also:
        Component.getLocation(), Component.setBounds(int, int, int, int), Component.invalidate()
        Inherited member indicator setMaximumSize Reveal DetailHide Detail
        void setMaximumSize(Dimension maximumSize)
        Sets the maximum size of this component to a constant value.
        public void setMaximumSize(Dimension maximumSize)
        Description copied from class: Component
        Sets the maximum size of this component to a constant value. Subsequent calls to getMaximumSize will always return this value. Setting the maximum size to null restores the default behavior.
        Parameters:
        maximumSize - a Dimension containing the desired maximum allowable size
        Since:
        1.5
        See Also:
        Component.getMaximumSize(), Component.isMaximumSizeSet()
        Inherited member indicator setMinimumSize Reveal DetailHide Detail
        void setMinimumSize(Dimension minimumSize)
        Sets the minimum size of this component to a constant value.
        public void setMinimumSize(Dimension minimumSize)
        Description copied from class: Component
        Sets the minimum size of this component to a constant value. Subsequent calls to getMinimumSize will always return this value. Setting the minimum size to null restores the default behavior.
        Parameters:
        minimumSize - the new minimum size of this component
        Since:
        1.5
        See Also:
        Component.getMinimumSize(), Component.isMinimumSizeSet()
        Inherited member indicator setPreferredSize Reveal DetailHide Detail
        void setPreferredSize(Dimension preferredSize)
        Sets the preferred size of this component to a constant value.
        public void setPreferredSize(Dimension preferredSize)
        Description copied from class: Component
        Sets the preferred size of this component to a constant value. Subsequent calls to getPreferredSize will always return this value. Setting the preferred size to null restores the default behavior.
        Parameters:
        preferredSize - The new preferred size, or null
        Since:
        1.5
        See Also:
        Component.getPreferredSize(), Component.isPreferredSizeSet()
        Inherited member indicator setSize Reveal DetailHide Detail
        void setSize(Dimension d)
        Resizes this component so that it has width d.width and height d.height.
        public void setSize(Dimension d)
        Description copied from class: Component
        Resizes this component so that it has width d.width and height d.height.

        This method changes layout-related information, and therefore, invalidates the component hierarchy.

        Parameters:
        d - the dimension specifying the new size of this component
        Throws:
        java.lang.NullPointerException - if d is null
        Since:
        JDK1.1
        See Also:
        Component.setSize(int, int), Component.setBounds(int, int, int, int), Component.invalidate()
        Inherited member indicator setSize Reveal DetailHide Detail
        void setSize(int width, int height)
        Resizes this component so that it has width width and height height.
        public void setSize(int width, int height)
        Description copied from class: Component
        Resizes this component so that it has width width and height height.

        This method changes layout-related information, and therefore, invalidates the component hierarchy.

        Parameters:
        width - the new width of this component in pixels
        height - the new height of this component in pixels
        Since:
        JDK1.1
        See Also:
        Component.getSize(), Component.setBounds(int, int, int, int), Component.invalidate()
        Inherited member indicator size Reveal DetailHide Detail
        Dimension size()
        Deprecated. As of JDK version 1.1, replaced by getSize().
        @Deprecated public Dimension size()
        Deprecated. As of JDK version 1.1, replaced by getSize().
        Inherited member indicator validate Reveal DetailHide Detail
        void validate()
        Validates this container and all of its subcomponents.
        public void validate()
        Description copied from class: Container
        Validates this container and all of its subcomponents.

        Validating a container means laying out its subcomponents. Layout-related changes, such as setting the bounds of a component, or adding a component to the container, invalidate the container automatically. Note that the ancestors of the container may be invalidated also (see Component.invalidate() for details.) Therefore, to restore the validity of the hierarchy, the validate() method should be invoked on the top-most invalid container of the hierarchy.

        Validating the container may be a quite time-consuming operation. For performance reasons a developer may postpone the validation of the hierarchy till a set of layout-related operations completes, e.g. after adding all the children to the container.

        If this Container is not valid, this method invokes the validateTree method and marks this Container as valid. Otherwise, no action is performed.

        Overrides:
        validate in class Component
        See Also:
        Container.add(java.awt.Component), Container.invalidate(), Container.isValidateRoot(), JComponent.revalidate(), Container.validateTree()
        Inherited member indicator validateTree Reveal DetailHide Detail
        protected void validateTree()
        Recursively descends the container tree and recomputes the layout for any subtrees marked as needing it (those marked as invalid).
        protected void validateTree()
        Description copied from class: Container
        Recursively descends the container tree and recomputes the layout for any subtrees marked as needing it (those marked as invalid). Synchronization should be provided by the method that calls this one: validate.
        See Also:
        Container.doLayout(), Container.validate()
      • Painting Methods 
        Modifier and Type Method and Description
        Inherited member indicator getIgnoreRepaint Reveal DetailHide Detail
        boolean getIgnoreRepaint()
         
        public boolean getIgnoreRepaint()
        Inherited member indicator paint Reveal DetailHide Detail
        void paint(Graphics g)
        Paints the container.
        public void paint(Graphics g)
        Description copied from class: Container
        Paints the container. This forwards the paint to any lightweight components that are children of this container. If this method is reimplemented, super.paint(g) should be called so that lightweight components are properly rendered. If a child component is entirely clipped by the current clipping setting in g, paint() will not be forwarded to that child.
        Overrides:
        paint in class Component
        Parameters:
        g - the specified Graphics window
        See Also:
        Component.update(Graphics)
        Inherited member indicator paintAll Reveal DetailHide Detail
        void paintAll(Graphics g)
        Paints this component and all of its subcomponents.
        public void paintAll(Graphics g)
        Description copied from class: Component
        Paints this component and all of its subcomponents.

        The origin of the graphics context, its (0, 0) coordinate point, is the top-left corner of this component. The clipping region of the graphics context is the bounding rectangle of this component.

        Parameters:
        g - the graphics context to use for painting
        Since:
        JDK1.0
        See Also:
        Component.paint(java.awt.Graphics)
        Inherited member indicator paintComponents Reveal DetailHide Detail
        void paintComponents(Graphics g)
        Paints each of the components in this container.
        public void paintComponents(Graphics g)
        Description copied from class: Container
        Paints each of the components in this container.
        Parameters:
        g - the graphics context.
        See Also:
        Component.paint(java.awt.Graphics), Component.paintAll(java.awt.Graphics)
        Inherited member indicator repaint Reveal DetailHide Detail
        void repaint()
        Repaints this component.
        public void repaint()
        Description copied from class: Component
        Repaints this component.

        If this component is a lightweight component, this method causes a call to this component's paint method as soon as possible. Otherwise, this method causes a call to this component's update method as soon as possible.

        Note: For more information on the paint mechanisms utilitized by AWT and Swing, including information on how to write the most efficient painting code, see Painting in AWT and Swing.

        Since:
        JDK1.0
        See Also:
        Component.update(Graphics)
        Inherited member indicator repaint Reveal DetailHide Detail
        void repaint(int x, int y, int width, int height)
        Repaints the specified rectangle of this component.
        public void repaint(int x, int y, int width, int height)
        Description copied from class: Component
        Repaints the specified rectangle of this component.

        If this component is a lightweight component, this method causes a call to this component's paint method as soon as possible. Otherwise, this method causes a call to this component's update method as soon as possible.

        Note: For more information on the paint mechanisms utilitized by AWT and Swing, including information on how to write the most efficient painting code, see Painting in AWT and Swing.

        Parameters:
        x - the x coordinate
        y - the y coordinate
        width - the width
        height - the height
        Since:
        JDK1.0
        See Also:
        Component.update(Graphics)
        Inherited member indicator repaint Reveal DetailHide Detail
        void repaint(long tm)
        Repaints the component.
        public void repaint(long tm)
        Description copied from class: Component
        Repaints the component. If this component is a lightweight component, this results in a call to paint within tm milliseconds.

        Note: For more information on the paint mechanisms utilitized by AWT and Swing, including information on how to write the most efficient painting code, see Painting in AWT and Swing.

        Parameters:
        tm - maximum time in milliseconds before update
        Since:
        JDK1.0
        See Also:
        Component.paint(java.awt.Graphics), Component.update(Graphics)
        Inherited member indicator repaint Reveal DetailHide Detail
        void repaint(long tm, int x, int y, int width, int height)
        Repaints the specified rectangle of this component within tm milliseconds.
        public void repaint(long tm, int x, int y, int width, int height)
        Description copied from class: Component
        Repaints the specified rectangle of this component within tm milliseconds.

        If this component is a lightweight component, this method causes a call to this component's paint method. Otherwise, this method causes a call to this component's update method.

        Note: For more information on the paint mechanisms utilitized by AWT and Swing, including information on how to write the most efficient painting code, see Painting in AWT and Swing.

        Parameters:
        tm - maximum time in milliseconds before update
        x - the x coordinate
        y - the y coordinate
        width - the width
        height - the height
        Since:
        JDK1.0
        See Also:
        Component.update(Graphics)
        Inherited member indicator setIgnoreRepaint Reveal DetailHide Detail
        void setIgnoreRepaint(boolean ignoreRepaint)
        Sets whether or not paint messages received from the operating system should be ignored.
        public void setIgnoreRepaint(boolean ignoreRepaint)
        Description copied from class: Component
        Sets whether or not paint messages received from the operating system should be ignored. This does not affect paint events generated in software by the AWT, unless they are an immediate response to an OS-level paint message.

        This is useful, for example, if running under full-screen mode and better performance is desired, or if page-flipping is used as the buffer strategy.

        Since:
        1.4
        See Also:
        Component.getIgnoreRepaint(), Canvas.createBufferStrategy(int), Window.createBufferStrategy(int), BufferStrategy, GraphicsDevice.setFullScreenWindow(java.awt.Window)
        Inherited member indicator update Reveal DetailHide Detail
        void update(Graphics g)
        Updates the container.
        public void update(Graphics g)
        Description copied from class: Container
        Updates the container. This forwards the update to any lightweight components that are children of this container. If this method is reimplemented, super.update(g) should be called so that lightweight components are properly rendered. If a child component is entirely clipped by the current clipping setting in g, update() will not be forwarded to that child.
        Overrides:
        update in class Component
        Parameters:
        g - the specified Graphics window
        See Also:
        Component.update(Graphics)
      • Printing Methods 
        Modifier and Type Method and Description
        Inherited member indicator list Reveal DetailHide Detail
        void list()
        Prints a listing of this component to the standard system output stream System.out.
        public void list()
        Description copied from class: Component
        Prints a listing of this component to the standard system output stream System.out.
        Since:
        JDK1.0
        See Also:
        System.out
        Inherited member indicator list Reveal DetailHide Detail
        void list(java.io.PrintStream out)
        Prints a listing of this component to the specified output stream.
        public void list(java.io.PrintStream out)
        Description copied from class: Component
        Prints a listing of this component to the specified output stream.
        Parameters:
        out - a print stream
        Throws:
        java.lang.NullPointerException - if out is null
        Since:
        JDK1.0
        Inherited member indicator list Reveal DetailHide Detail
        void list(java.io.PrintStream out, int indent)
        Prints a listing of this container to the specified output stream.
        public void list(java.io.PrintStream out, int indent)
        Description copied from class: Container
        Prints a listing of this container to the specified output stream. The listing starts at the specified indentation.

        The immediate children of the container are printed with an indentation of indent+1. The children of those children are printed at indent+2 and so on.

        Overrides:
        list in class Component
        Parameters:
        out - a print stream
        indent - the number of spaces to indent
        Throws:
        java.lang.NullPointerException - if out is null
        Since:
        JDK1.0
        See Also:
        Component.list(java.io.PrintStream, int)
        Inherited member indicator list Reveal DetailHide Detail
        void list(java.io.PrintWriter out)
        Prints a listing to the specified print writer.
        public void list(java.io.PrintWriter out)
        Description copied from class: Component
        Prints a listing to the specified print writer.
        Parameters:
        out - the print writer to print to
        Throws:
        java.lang.NullPointerException - if out is null
        Since:
        JDK1.1
        Inherited member indicator list Reveal DetailHide Detail
        void list(java.io.PrintWriter out, int indent)
        Prints out a list, starting at the specified indentation, to the specified print writer.
        public void list(java.io.PrintWriter out, int indent)
        Description copied from class: Container
        Prints out a list, starting at the specified indentation, to the specified print writer.

        The immediate children of the container are printed with an indentation of indent+1. The children of those children are printed at indent+2 and so on.

        Overrides:
        list in class Component
        Parameters:
        out - a print writer
        indent - the number of spaces to indent
        Throws:
        java.lang.NullPointerException - if out is null
        Since:
        JDK1.1
        See Also:
        Component.list(java.io.PrintWriter, int)
        Inherited member indicator print Reveal DetailHide Detail
        void print(Graphics g)
        Prints the container.
        public void print(Graphics g)
        Description copied from class: Container
        Prints the container. This forwards the print to any lightweight components that are children of this container. If this method is reimplemented, super.print(g) should be called so that lightweight components are properly rendered. If a child component is entirely clipped by the current clipping setting in g, print() will not be forwarded to that child.
        Overrides:
        print in class Component
        Parameters:
        g - the specified Graphics window
        See Also:
        Component.update(Graphics)
        Inherited member indicator printAll Reveal DetailHide Detail
        void printAll(Graphics g)
        Prints this component and all of its subcomponents.
        public void printAll(Graphics g)
        Description copied from class: Component
        Prints this component and all of its subcomponents.

        The origin of the graphics context, its (0, 0) coordinate point, is the top-left corner of this component. The clipping region of the graphics context is the bounding rectangle of this component.

        Parameters:
        g - the graphics context to use for printing
        Since:
        JDK1.0
        See Also:
        Component.print(Graphics)
        Overridden member indicator printComponents Reveal DetailHide Detail
        void printComponents(Graphics g)
        Prints the component in this scroll pane.
        public void printComponents(Graphics g)
        Prints the component in this scroll pane.
        Overrides:
        printComponents in class Container
        Parameters:
        g - the specified Graphics window
        See Also:
        Component.print(java.awt.Graphics), Component.printAll(java.awt.Graphics)
      • Other Methods 
        Modifier and Type Method and Description
        Inherited member indicator add Reveal DetailHide Detail
        void add(PopupMenu popup)
        Adds the specified popup menu to the component.
        public void add(PopupMenu popup)
        Description copied from class: Component
        Adds the specified popup menu to the component.
        Parameters:
        popup - the popup menu to be added to the component.
        Throws:
        java.lang.NullPointerException - if popup is null
        Since:
        JDK1.1
        See Also:
        Component.remove(MenuComponent)
        Overridden member indicator addNotify Reveal DetailHide Detail
        void addNotify()
        Creates the scroll pane's peer.
        public void addNotify()
        Creates the scroll pane's peer.
        Overrides:
        addNotify in class Container
        See Also:
        Component.isDisplayable(), Container.removeNotify()
        Overridden member indicator eventTypeEnabled Reveal DetailHide Detail
        protected boolean eventTypeEnabled(int type)
        If wheel scrolling is enabled, we return true for MouseWheelEvents
        protected boolean eventTypeEnabled(int type)
        If wheel scrolling is enabled, we return true for MouseWheelEvents
        Since:
        1.4
        Inherited member indicator getDropTarget Reveal DetailHide Detail
        java.awt.dnd.DropTarget getDropTarget()
        Gets the DropTarget associated with this Component.
        public java.awt.dnd.DropTarget getDropTarget()
        Description copied from class: Component
        Gets the DropTarget associated with this Component.
        Ordinary member indicator getHAdjustable Reveal DetailHide Detail
        Adjustable getHAdjustable()
        Returns the ScrollPaneAdjustable object which represents the state of the horizontal scrollbar.
        public Adjustable getHAdjustable()
        Returns the ScrollPaneAdjustable object which represents the state of the horizontal scrollbar. The declared return type of this method is Adjustable to maintain backward compatibility.
        See Also:
        ScrollPaneAdjustable
        Ordinary member indicator getHScrollbarHeight Reveal DetailHide Detail
        int getHScrollbarHeight()
        Returns the height that would be occupied by a horizontal scrollbar, which is independent of whether it is currently displayed by the scroll pane or not.
        public int getHScrollbarHeight()
        Returns the height that would be occupied by a horizontal scrollbar, which is independent of whether it is currently displayed by the scroll pane or not.
        Returns:
        the height of a horizontal scrollbar in pixels
        Inherited member indicator getInputContext Reveal DetailHide Detail
        java.awt.im.InputContext getInputContext()
        Gets the input context used by this component for handling the communication with input methods when text is entered in this component.
        public java.awt.im.InputContext getInputContext()
        Description copied from class: Component
        Gets the input context used by this component for handling the communication with input methods when text is entered in this component. By default, the input context used for the parent component is returned. Components may override this to return a private input context.
        Returns:
        the input context used by this component; null if no context can be determined
        Since:
        1.2
        Inherited member indicator getInputMethodRequests Reveal DetailHide Detail
        java.awt.im.InputMethodRequests getInputMethodRequests()
        Gets the input method request handler which supports requests from input methods for this component.
        public java.awt.im.InputMethodRequests getInputMethodRequests()
        Description copied from class: Component
        Gets the input method request handler which supports requests from input methods for this component. A component that supports on-the-spot text input must override this method to return an InputMethodRequests instance. At the same time, it also has to handle input method events.
        Returns:
        the input method request handler for this component, null by default
        Since:
        1.2
        See Also:
        Component.addInputMethodListener(java.awt.event.InputMethodListener)
        Inherited member indicator getPeer Reveal DetailHide Detail
        java.awt.peer.ComponentPeer getPeer()
        Deprecated. As of JDK version 1.1, programs should not directly manipulate peers; replaced by boolean isDisplayable().
        @Deprecated public java.awt.peer.ComponentPeer getPeer()
        Deprecated. As of JDK version 1.1, programs should not directly manipulate peers; replaced by boolean isDisplayable().
        Ordinary member indicator getScrollbarDisplayPolicy Reveal DetailHide Detail
        int getScrollbarDisplayPolicy()
        Returns the display policy for the scrollbars.
        public int getScrollbarDisplayPolicy()
        Returns the display policy for the scrollbars.
        Returns:
        the display policy for the scrollbars
        Ordinary member indicator getScrollPosition Reveal DetailHide Detail
        Point getScrollPosition()
        Returns the current x,y position within the child which is displayed at the 0,0 location of the scrolled panel's view port.
        public Point getScrollPosition()
        Returns the current x,y position within the child which is displayed at the 0,0 location of the scrolled panel's view port. This is a convenience method which interfaces with the adjustable objects which represent the state of the scrollbars.
        Returns:
        the coordinate position for the current scroll position
        Throws:
        java.lang.NullPointerException - if the scrollpane does not contain a child
        Inherited member indicator getTreeLock Reveal DetailHide Detail
        java.lang.Object getTreeLock()
        Gets this component's locking object (the object that owns the thread synchronization monitor) for AWT component-tree and layout operations.
        public final java.lang.Object getTreeLock()
        Description copied from class: Component
        Gets this component's locking object (the object that owns the thread synchronization monitor) for AWT component-tree and layout operations.
        Returns:
        this component's locking object
        Ordinary member indicator getVAdjustable Reveal DetailHide Detail
        Adjustable getVAdjustable()
        Returns the ScrollPaneAdjustable object which represents the state of the vertical scrollbar.
        public Adjustable getVAdjustable()
        Returns the ScrollPaneAdjustable object which represents the state of the vertical scrollbar. The declared return type of this method is Adjustable to maintain backward compatibility.
        See Also:
        ScrollPaneAdjustable
        Ordinary member indicator getViewportSize Reveal DetailHide Detail
        Dimension getViewportSize()
        Returns the current size of the scroll pane's view port.
        public Dimension getViewportSize()
        Returns the current size of the scroll pane's view port.
        Returns:
        the size of the view port in pixels
        Ordinary member indicator getVScrollbarWidth Reveal DetailHide Detail
        int getVScrollbarWidth()
        Returns the width that would be occupied by a vertical scrollbar, which is independent of whether it is currently displayed by the scroll pane or not.
        public int getVScrollbarWidth()
        Returns the width that would be occupied by a vertical scrollbar, which is independent of whether it is currently displayed by the scroll pane or not.
        Returns:
        the width of a vertical scrollbar in pixels
        Ordinary member indicator isWheelScrollingEnabled Reveal DetailHide Detail
        boolean isWheelScrollingEnabled()
        Indicates whether or not scrolling will take place in response to the mouse wheel.
        public boolean isWheelScrollingEnabled()
        Indicates whether or not scrolling will take place in response to the mouse wheel. Wheel scrolling is enabled by default.
        Since:
        1.4
        See Also:
        setWheelScrollingEnabled(boolean)
        Overridden member indicator paramString Reveal DetailHide Detail
        java.lang.String paramString()
        Returns a string representing the state of this ScrollPane.
        public java.lang.String paramString()
        Returns a string representing the state of this ScrollPane. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.
        Overrides:
        paramString in class Container
        Returns:
        the parameter string of this scroll pane
        Inherited member indicator remove Reveal DetailHide Detail
        void remove(MenuComponent popup)
        Removes the specified popup menu from the component.
        public void remove(MenuComponent popup)
        Description copied from class: Component
        Removes the specified popup menu from the component.
        Specified by:
        remove in interface MenuContainer
        Parameters:
        popup - the popup menu to be removed
        Since:
        JDK1.1
        See Also:
        Component.add(PopupMenu)
        Inherited member indicator removeNotify Reveal DetailHide Detail
        void removeNotify()
        Makes this Container undisplayable by removing its connection to its native screen resource.
        public void removeNotify()
        Description copied from class: Container
        Makes this Container undisplayable by removing its connection to its native screen resource. Making a container undisplayable will cause all of its children to be made undisplayable. This method is called by the toolkit internally and should not be called directly by programs.
        Overrides:
        removeNotify in class Component
        See Also:
        Component.isDisplayable(), Container.addNotify()
        Inherited member indicator setDropTarget Reveal DetailHide Detail
        void setDropTarget(java.awt.dnd.DropTarget dt)
        Associate a DropTarget with this component.
        public void setDropTarget(java.awt.dnd.DropTarget dt)
        Description copied from class: Component
        Associate a DropTarget with this component. The Component will receive drops only if it is enabled.
        Parameters:
        dt - The DropTarget
        See Also:
        Component.isEnabled()
        Ordinary member indicator setScrollPosition Reveal DetailHide Detail
        void setScrollPosition(int x, int y)
        Scrolls to the specified position within the child component.
        public void setScrollPosition(int x, int y)
        Scrolls to the specified position within the child component. A call to this method is only valid if the scroll pane contains a child. Specifying a position outside of the legal scrolling bounds of the child will scroll to the closest legal position. Legal bounds are defined to be the rectangle: x = 0, y = 0, width = (child width - view port width), height = (child height - view port height). This is a convenience method which interfaces with the Adjustable objects which represent the state of the scrollbars.
        Parameters:
        x - the x position to scroll to
        y - the y position to scroll to
        Throws:
        java.lang.NullPointerException - if the scrollpane does not contain a child
        Ordinary member indicator setScrollPosition Reveal DetailHide Detail
        void setScrollPosition(Point p)
        Scrolls to the specified position within the child component.
        public void setScrollPosition(Point p)
        Scrolls to the specified position within the child component. A call to this method is only valid if the scroll pane contains a child and the specified position is within legal scrolling bounds of the child. Specifying a position outside of the legal scrolling bounds of the child will scroll to the closest legal position. Legal bounds are defined to be the rectangle: x = 0, y = 0, width = (child width - view port width), height = (child height - view port height). This is a convenience method which interfaces with the Adjustable objects which represent the state of the scrollbars.
        Parameters:
        p - the Point representing the position to scroll to
        Throws:
        java.lang.NullPointerException - if p is null
        Ordinary member indicator setWheelScrollingEnabled Reveal DetailHide Detail
        void setWheelScrollingEnabled(boolean handleWheel)
        Enables/disables scrolling in response to movement of the mouse wheel.
        public void setWheelScrollingEnabled(boolean handleWheel)
        Enables/disables scrolling in response to movement of the mouse wheel. Wheel scrolling is enabled by default.
        Parameters:
        handleWheel - true if scrolling should be done automatically for a MouseWheelEvent, false otherwise.
        Since:
        1.4
        See Also:
        isWheelScrollingEnabled(), MouseWheelEvent, MouseWheelListener
        Inherited member indicator toString Reveal DetailHide Detail
        java.lang.String toString()
        Returns a string representation of this component and its values.
        public java.lang.String toString()
        Description copied from class: Component
        Returns a string representation of this component and its values.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this component
        Since:
        JDK1.0
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
This document was created by Dulcet from the OpenJDK sources. Copyright © 1993, 2012 Oracle and/or its affiliates. All rights reserved.

SourceForge