java::awt::Component Class Reference

Inheritance diagram for java::awt::Component:

Inheritance graph
java::awt::Buttonjava::awt::Canvasjava::awt::Checkboxjava::awt::Choicejava::awt::Containerjava::awt::Labeljava::awt::ListBoxjava::awt::Scrollbarjava::awt::TextComponentjava::lang::Objectjava::lang::Interfacejava::lang::Syncjava::awt::event::ComponentSourcejava::awt::event::FocusSourcejava::awt::event::HierarchySourcejava::awt::event::KeySourcejava::awt::event::MouseSourcejava::awt::event::PaintSourcejava::util::PropertyChangeSourcejava::lang::Lockjava::lang::ScopeAdapterjava::awt::image::ImageObserverjava::util::EventSourcejava::awt::Paneljava::awt::Windowjava::awt::Dialogjava::awt::Framejava::awt::TextAreajava::awt::TextField
[legend]
Collaboration diagram for java::awt::Component:

Collaboration graph
java::lang::Objectjava::lang::Interfacejava::lang::ObjectRefjava::lang::Syncjava::awt::event::ComponentSourcejava::awt::event::FocusSourcejava::awt::event::HierarchySourcejava::awt::event::KeySourcejava::awt::event::MouseSourcejava::awt::event::PaintSourcejava::util::PropertyChangeSourcejava::lang::Lockjava::lang::ScopeAdapterjava::lang::Comparablejava::awt::image::ImageObserverjava::util::EventSourcejava::util::Collectionjava::util::LinkedListjava::util::AbstractSequentialListjava::util::AbstractListjava::util::AbstractCollectionjava::util::List
[legend]

List of all members.


Detailed Description

A component is an object having a graphical representation that can be displayed on the screen and that can interact with the user.

Examples of components are the buttons, checkboxes, and scrollbars of a typical graphical user interface.

The Component class is the abstract superclass of the nonmenu-related Abstract Window Toolkit components. Class Component can also be extended directly to create a lightweight component. A lightweight component is a component that is not associated with a native opaque window.

Serialization

It is important to note that only AWT listeners which conform to the Serializable protocol will be saved when the object is stored. If an AWT object has listeners that aren't marked serializable, they will be dropped at writeObject time. Developers will need, as always, to consider the implications of making an object serializable. One situation to watch out for is this:

    import java.awt.*;
    import java.awt.event.*;
    import java.io.Serializable;

    class MyApp implements ActionListener, Serializable
    {
        BigObjectThatShouldNotBeSerializedWithAButton bigOne;
        Button aButton = new Button();

        MyApp()
        {
            // Oops, now aButton has a listener with a reference
            // to bigOne!
            aButton.addActionListener(this);
        }

        public void actionPerformed(ActionEvent e)
        {
            System.out.println("Hello There");
        }
    }
 
In this example, serializing aButton by itself will cause MyApp and everything it refers to to be serialized as well. The problem is that the listener is serializable by coincidence, not by design. To separate the decisions about MyApp and the ActionListener being serializable one can use a nested class, as in the following example:
    import java.awt.*;
    import java.awt.event.*;
    import java.io.Serializable;

    class MyApp java.io.Serializable
    {
         BigObjectThatShouldNotBeSerializedWithAButton bigOne;
         Button aButton = new Button();

         class MyActionListener implements ActionListener
         {
             public void actionPerformed(ActionEvent e)
             {
                 System.out.println("Hello There");
             }
         }

         MyApp()
         {
             aButton.addActionListener(new MyActionListener());
         }
    }
 

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.

Version:
1.357, 04/14/03
Author:
Arthur van Hoff

Sami Shaio


Public Member Functions

virtual String getName () const
 Gets the name of the component.
virtual void setName (const String &name)
 Sets the name of the component to the specified string.
virtual Ref< ContainergetParent () const
 Gets the parent of this component.
virtual Ref< ToolkitgetToolkit () const
 Gets the toolkit of this component.
virtual jboolean isValid () const
 Determines whether this component is valid.
virtual jboolean isDisplayable () const
 Determines whether this component is displayable.
virtual jboolean isVisible () const
 Determines whether this component should be visible when its parent is visible.
virtual jboolean isRecursivelyVisible () const
 Determines whether this component will be displayed on the screen if it's displayable.
virtual jboolean isShowing () const
 Determines whether this component is showing on screen.
virtual jboolean isEnabled () const
 Determines whether this component is enabled.
virtual void setEnabled (jboolean b)
 Enables or disables this component, depending on the value of the parameter b.
virtual jboolean isDoubleBuffered () const
 Returns true if this component is painted to an offscreen image ("buffer") that's copied to the screen later.
virtual void setVisible (jboolean b)
 Shows or hides this component depending on the value of parameter b.
virtual Ref< ColorgetForeground () const
 Gets the foreground color of this component.
virtual void setForeground (const Ref< Color > &c)
 Sets the foreground color of this component.
virtual jboolean isForegroundSet () const
 Returns whether the foreground color has been explicitly set for this Component.
virtual Ref< ColorgetBackground () const
 Gets the background color of this component.
virtual void setBackground (const Ref< Color > &c)
 Sets the background color of this component.
virtual jboolean isBackgroundSet () const
 Returns whether the background color has been explicitly set for this Component.
virtual Ref< FontgetFont () const
 Gets the font of this component.
virtual void setFont (const Ref< Font > &f)
 Sets the font of this component.
virtual jboolean isFontSet () const
 Returns whether the font has been explicitly set for this Component.
virtual Ref< ColorModelgetColorModel () const
 Gets the instance of ColorModel used to display the component on the output device.
virtual Point getLocation () const
 Gets the location of this component in the form of a point specifying the component's top-left corner.
virtual Point getLocationOnScreen () const
 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.
virtual void setLocation (jint x, jint y)
 Moves this component to a new location.
virtual void setLocation (const Point &p)
 Moves this component to a new location.
virtual Dimension getSize () const
 Returns the size of this component in the form of a Dimension object.
virtual void setSize (jint width, jint height)
 Resizes this component so that it has width width and height height.
virtual void setSize (const Dimension &d)
 Resizes this component so that it has width d.width and height d.height.
virtual Rectangle getBounds () const
 Gets the bounds of this component in the form of a Rectangle object.
virtual void setBounds (jint x, jint y, jint width, jint height)
 Moves and resizes this component.
virtual void setBounds (const Rectangle &r)
 Moves and resizes this component to conform to the new bounding rectangle r.
virtual jint getX () const
 Returns the current x coordinate of the components origin.
virtual jint getY () const
 Returns the current y coordinate of the components origin.
virtual jint getWidth () const
 Returns the current width of this component.
virtual jint getHeight () const
 Returns the current height of this component.
virtual Rectangle getBounds (Rectangle &rv)
 Stores the bounds of this component into "return value" rv and return rv.
virtual Dimension getSize (Dimension &rv)
 Stores the width/height of this component into "return value" rv and return rv.
virtual Point getLocation (Point &rv)
 Stores the x,y origin of this component into "return value" rv and return rv.
virtual jboolean isOpaque () const
 Returns true if this component is completely opaque, returns false by default.
virtual jboolean isLightweight () const
 A lightweight component doesn't have a native toolkit peer.
virtual Dimension getPreferredSize () const
 Gets the preferred size of this component.
virtual Dimension getMinimumSize () const
 Gets the mininimum size of this component.
virtual Dimension getMaximumSize () const
 Gets the maximum size of this component.
virtual jfloat getAlignmentX () const
 Returns the alignment along the x axis.
virtual jfloat getAlignmentY () const
 Returns the alignment along the y axis.
virtual void doLayout ()
 Prompts the layout manager to lay out this component.
virtual void validate ()
 Ensures that this component has a valid layout.
virtual void invalidate ()
 Invalidates this component.
virtual Ref< GraphicsgetGraphics ()
 Creates a graphics context for this component.
virtual Ref
< FontMetrics
getFontMetrics (const Ref< Font > &font=0)
 Gets the font metrics for the specified font.
virtual void paint (Graphics &g)
 Paints this component.
virtual void paintAll (Graphics &g)
 Paints this component and all of its subcomponents.
virtual void repaint (jlong tm=0)
 Repaints this component.
virtual void repaint (jint x, jint y, jint width, jint height, jlong tm=0)
 Repaints the specified rectangle of this component within tm milliseconds.
virtual void print (Graphics &g)
 Prints this component.
virtual void printAll (Graphics &g)
 Prints this component and all of its subcomponents.
virtual jboolean imageUpdate (const Ref< Image > &img, jint infoflags, jint x, jint y, jint width, jint height)
 Repaints the component when the image has changed.
virtual Ref< ImagecreateImage (const Ref< ImageProducer > &producer)
 Creates an image from the specified image producer.
virtual Ref< ImagecreateImage (jint width, jint height)
 Creates an off-screen drawable image to be used for double buffering.
virtual jboolean prepareImage (const Ref< Image > &image, jint width, jint height, const Ref< ImageObserver > &observer)
 Prepares an image for rendering on this component at the specified width and height.
virtual jint checkImage (const Ref< Image > &image, jint width, jint height, const Ref< ImageObserver > &observer)
 Returns the status of the construction of a screen representation of the specified image.
virtual void setIgnoreRepaint (jboolean ignoreRepaint)
 Sets whether or not paint messages received from the operating system should be ignored.
virtual jboolean getIgnoreRepaint () const
 
Returns:
whether or not paint messages received from the operating system should be ignored.

virtual jboolean contains (jint x, jint y) const
 Checks whether this component "contains" the specified point, where x and y are defined to be relative to the coordinate system of this component.
virtual jboolean contains (const Point &p) const
 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.
virtual Ref< ComponentgetComponentAt (jint x, jint y) const
 Determines if this component or one of its immediate subcomponents contains the (xy) location, and if so, returns the containing component.
virtual Ref< ComponentgetComponentAt (const Point &p) const
 Returns the component or subcomponent that contains the specified point.
virtual void addNotify ()
 Makes this Component displayable by connecting it to a native screen resource.
virtual void removeNotify ()
 Makes this Component undisplayable by destroying it native screen resource.
virtual void dispatchEvent (AWTEvent &e)
 Dispatches an event to this component or one of its sub components.
virtual Ref< AWTEventcoalesceEvents (const Ref< AWTEvent > &existingEvent, const Ref< AWTEvent > &newEvent) const
 Potentially coalesce an event being posted with an existing event.
virtual String toString () const
 Returns a string representation of this component and its values.
virtual void setComponentOrientation (const ComponentOrientation &o)
 Sets the language-sensitive orientation that is to be used to order the elements or text within this component.
virtual void applyComponentOrientation (const ComponentOrientation &o)
 Sets the ComponentOrientation property of this component and all components contained within it.
virtual const
ComponentOrientation
getComponentOrientation () const
 Retrieves the language-sensitive orientation that is to be used to order the elements or text within this component.
virtual Ref< ListgetListeners (const Class &type) const
 Returns an array of all the objects currently registered as FooListeners upon this Component.
virtual jboolean eventEnabled (const AWTEvent &e) const
virtual void processEvent (const AWTEvent &e)
 Processes events occurring on this component.
virtual jboolean isFocusable () const
 Returns whether this Component can be focused.
virtual void setFocusable (jboolean focusable)
 Sets the focusable state of this Component to the specified value.
virtual void requestFocus (jboolean temporrary=false)
 Requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window.
virtual void requestFocusInWindow (jboolean temporrary=false)
 Requests that this Component get the input focus, if this Component's top-level ancestor is already the focused Window.
virtual Ref< ContainergetFocusCycleRootAncestor () const
 Returns the Container which is the focus cycle root of this Component's focus traversal cycle.
virtual jboolean isFocusCycleRoot (const Ref< Container > &container) const
 Returns whether the specified Container is the focus cycle root of this Component's focus traversal cycle.
virtual void transferFocus ()
 Transfers the focus to the next component, as though this Component were the focus owner.
virtual void transferFocusBackward ()
 Transfers the focus to the previous component, as though this Component were the focus owner.
virtual void transferFocusUpCycle ()
 Transfers the focus up one focus traversal cycle.
virtual jboolean isFocusOwner () const
 Returns true if this Component is the focus owner.

Static Public Member Functions

static Ref< SyncgetTreeLock ()
 Gets this component's locking object (the object that owns the thread sychronization monitor) for AWT component-tree and layout operations.

Public Attributes

ObjectRef impl
 Internal Implementation object.

Static Public Attributes

static const jfloat TOP_ALIGNMENT
 Ease-of-use constant for getAlignmentY().
static const jfloat CENTER_ALIGNMENT
 Ease-of-use constant for getAlignmentY and getAlignmentX.
static const jfloat BOTTOM_ALIGNMENT
 Ease-of-use constant for getAlignmentY.
static const jfloat LEFT_ALIGNMENT
 Ease-of-use constant for getAlignmentX.
static const jfloat RIGHT_ALIGNMENT
 Ease-of-use constant for getAlignmentX.

Member Function Documentation

virtual String java::awt::Component::getName (  )  const [virtual]

Gets the name of the component.

Returns:
this component's name
See also:
setName
Since:
JDK1.1

virtual void java::awt::Component::setName ( const String name  )  [virtual]

Sets the name of the component to the specified string.

Parameters:
name the string that is to be this component's name
See also:
getName
Since:
JDK1.1

virtual Ref<Container> java::awt::Component::getParent (  )  const [virtual]

Gets the parent of this component.

Returns:
the parent container of this component
Since:
JDK1.0

static Ref<Sync> java::awt::Component::getTreeLock (  )  [static]

Gets this component's locking object (the object that owns the thread sychronization monitor) for AWT component-tree and layout operations.

Returns:
this component's locking object

virtual Ref<Toolkit> java::awt::Component::getToolkit (  )  const [virtual]

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

virtual jboolean java::awt::Component::isValid (  )  const [virtual]

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. Components are invalidated when they are first shown on the screen.

Returns:
true if the component is valid, false otherwise
See also:
validate

invalidate

Since:
JDK1.0

virtual jboolean java::awt::Component::isDisplayable (  )  const [virtual]

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
See also:
Container::add(Component)

Window::pack

Window::show

Container::remove(Component)

Window::dispose

Since:
1.2

virtual jboolean java::awt::Component::isVisible (  )  const [virtual]

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
See also:
setVisible
Since:
JDK1.0

virtual jboolean java::awt::Component::isRecursivelyVisible (  )  const [virtual]

Determines whether this component will be displayed on the screen if it's displayable.

Returns:
true if the component and all of its ancestors are visible, false otherwise

virtual jboolean java::awt::Component::isShowing (  )  const [virtual]

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.

Returns:
true if the component is showing, false otherwise
See also:
setVisible
Since:
JDK1.0

virtual jboolean java::awt::Component::isEnabled (  )  const [virtual]

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
See also:
setEnabled
Since:
JDK1.0

virtual void java::awt::Component::setEnabled ( jboolean  b  )  [virtual]

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.

Parameters:
b If true, this component is enabled; otherwise this component is disabled
See also:
isEnabled

isLightweight

Since:
JDK1.1

virtual jboolean java::awt::Component::isDoubleBuffered (  )  const [virtual]

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

virtual void java::awt::Component::setVisible ( jboolean  b  )  [virtual]

Shows or hides this component depending on the value of parameter b.

Parameters:
b if true, shows this component; otherwise, hides this component
See also:
isVisible
Since:
JDK1.1

Reimplemented in java::awt::Window.

virtual Ref<Color> java::awt::Component::getForeground (  )  const [virtual]

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
See also:
setForeground
Since:
JDK1.0 bound: true

virtual void java::awt::Component::setForeground ( const Ref< Color > &  c  )  [virtual]

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
See also:
getForeground
Since:
JDK1.0

virtual jboolean java::awt::Component::isForegroundSet (  )  const [virtual]

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

virtual Ref<Color> java::awt::Component::getBackground (  )  const [virtual]

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
See also:
setBackground
Since:
JDK1.0

virtual void java::awt::Component::setBackground ( const Ref< Color > &  c  )  [virtual]

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
See also:
getBackground
Since:
JDK1.0 bound: true

virtual jboolean java::awt::Component::isBackgroundSet (  )  const [virtual]

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

virtual Ref<Font> java::awt::Component::getFont (  )  const [virtual]

Gets the font of this component.

Returns:
this component's font; if a font has not been set for this component, the font of its parent is returned
See also:
setFont
Since:
JDK1.0

Reimplemented in java::awt::Frame.

virtual void java::awt::Component::setFont ( const Ref< Font > &  f  )  [virtual]

Sets the font of this component.

Parameters:
f the font to become this component's font; if this parameter is null then this component will inherit the font of its parent
See also:
getFont
Since:
JDK1.0 bound: true

Reimplemented in java::awt::Container.

virtual jboolean java::awt::Component::isFontSet (  )  const [virtual]

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

virtual Ref<ColorModel> java::awt::Component::getColorModel (  )  const [virtual]

Gets the instance of ColorModel used to display the component on the output device.

Returns:
the color model used by this component
See also:
java.awt.image.ColorModel

java.awt.peer.ComponentPeer::getColorModel()

Toolkit::getColorModel()

Since:
JDK1.0

virtual Point java::awt::Component::getLocation (  )  const [virtual]

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
See also:
setLocation

getLocationOnScreen

Since:
JDK1.1

virtual Point java::awt::Component::getLocationOnScreen (  )  const [virtual]

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
Exceptions:
<code>IllegalComponentStateException</code> if the component is not showing on the screen
See also:
setLocation

getLocation

virtual void java::awt::Component::setLocation ( jint  x,
jint  y 
) [virtual]

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.

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
See also:
getLocation

setBounds

Since:
JDK1.1

virtual void java::awt::Component::setLocation ( const Point p  )  [virtual]

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.

Parameters:
p the point defining the top-left corner of the new location, given in the coordinate space of this component's parent
See also:
getLocation

setBounds

Since:
JDK1.1

virtual Dimension java::awt::Component::getSize (  )  const [virtual]

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
See also:
setSize
Since:
JDK1.1

virtual void java::awt::Component::setSize ( jint  width,
jint  height 
) [virtual]

Resizes this component so that it has width width and height height.

Parameters:
width the new width of this component in pixels
height the new height of this component in pixels
See also:
getSize

setBounds

Since:
JDK1.1

virtual void java::awt::Component::setSize ( const Dimension d  )  [virtual]

Resizes this component so that it has width d.width and height d.height.

Parameters:
d the dimension specifying the new size of this component
See also:
setSize

setBounds

Since:
JDK1.1

virtual Rectangle java::awt::Component::getBounds (  )  const [virtual]

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:
setBounds

getLocation

getSize

virtual void java::awt::Component::setBounds ( jint  x,
jint  y,
jint  width,
jint  height 
) [virtual]

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.

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
See also:
getBounds

setLocation(int, int)

setLocation(Point)

setSize(int, int)

setSize(Dimension)

Since:
JDK1.1

virtual void java::awt::Component::setBounds ( const Rectangle r  )  [virtual]

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

Parameters:
r the new bounding rectangle for this component
See also:
getBounds

setLocation(int, int)

setLocation(Point)

setSize(int, int)

setSize(Dimension)

Since:
JDK1.1

virtual jint java::awt::Component::getX (  )  const [virtual]

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

virtual jint java::awt::Component::getY (  )  const [virtual]

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

virtual jint java::awt::Component::getWidth (  )  const [virtual]

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

virtual jint java::awt::Component::getHeight (  )  const [virtual]

Returns the current height of this component.

This method is preferable to writing component.getBounds().height</code., or component.getSize().height because it doesn't cause any heap allocations.

Returns:
the current height of this component
Since:
1.2

virtual Rectangle java::awt::Component::getBounds ( Rectangle rv  )  [virtual]

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

virtual Dimension java::awt::Component::getSize ( Dimension rv  )  [virtual]

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

virtual Point java::awt::Component::getLocation ( Point rv  )  [virtual]

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

virtual jboolean java::awt::Component::isOpaque (  )  const [virtual]

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. Only lightweight components can be transparent.

Subclasses that guarantee to always completely paint their contents should override this method and return true. All of the "heavyweight" AWT components are opaque.

Returns:
true if this component is completely opaque
See also:
isLightweight
Since:
1.2

virtual jboolean java::awt::Component::isLightweight (  )  const [virtual]

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
See also:
isDisplayable
Since:
1.2

virtual Dimension java::awt::Component::getPreferredSize (  )  const [virtual]

Gets the preferred size of this component.

Returns:
a dimension object indicating this component's preferred size
See also:
getMinimumSize

LayoutManager

Reimplemented in java::awt::Container.

virtual Dimension java::awt::Component::getMinimumSize (  )  const [virtual]

Gets the mininimum size of this component.

Returns:
a dimension object indicating this component's minimum size
See also:
getPreferredSize

LayoutManager

Reimplemented in java::awt::Container.

virtual Dimension java::awt::Component::getMaximumSize (  )  const [virtual]

Gets the maximum size of this component.

Returns:
a dimension object indicating this component's maximum size
See also:
getMinimumSize

getPreferredSize

LayoutManager

Reimplemented in java::awt::Container.

virtual jfloat java::awt::Component::getAlignmentX (  )  const [virtual]

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.

Reimplemented in java::awt::Container.

virtual jfloat java::awt::Component::getAlignmentY (  )  const [virtual]

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.

Reimplemented in java::awt::Container.

virtual void java::awt::Component::doLayout (  )  [virtual]

Prompts the layout manager to lay out this component.

This is usually called when the component (more specifically, container) is validated.

See also:
validate

LayoutManager

Reimplemented in java::awt::Container.

virtual void java::awt::Component::validate (  )  [virtual]

Ensures that this component has a valid layout.

This method is primarily intended to operate on instances of Container.

See also:
invalidate

doLayout()

LayoutManager

Container::validate

Since:
JDK1.0

Reimplemented in java::awt::Container.

virtual void java::awt::Component::invalidate (  )  [virtual]

Invalidates this component.

This component and all parents above it are marked as needing to be laid out. This method can be called often, so it needs to execute quickly.

See also:
validate

doLayout

LayoutManager

Since:
JDK1.0

Reimplemented in java::awt::Container.

virtual Ref<Graphics> java::awt::Component::getGraphics (  )  [virtual]

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
See also:
paint
Since:
JDK1.0

virtual Ref<FontMetrics> java::awt::Component::getFontMetrics ( const Ref< Font > &  font = 0  )  [virtual]

Gets the font metrics for the specified font.

Parameters:
font the font for which font metrics is to be obtained
Returns:
the font metrics for font
See also:
getFont

getPeer

java.awt.peer.ComponentPeer::getFontMetrics(Font)

Toolkit::getFontMetrics(Font)

Since:
JDK1.0

virtual void java::awt::Component::paint ( Graphics g  )  [virtual]

Paints this component.

This method is called when the contents of the component should be painted; such as when the component is first being shown or is damaged and in need of repair. The clip rectangle in the Graphics parameter is set to the area which needs to be painted. Subclasses of Component that override this method need not call super.paint(g).

For performance reasons, Components with zero width or height aren't considered to need painting when they are first shown, and also aren't considered to need repair.

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:
g the graphics context to use for painting
See also:
update
Since:
JDK1.0

Reimplemented in java::awt::Container.

virtual void java::awt::Component::paintAll ( Graphics g  )  [virtual]

Paints this component and all of its subcomponents.

The origin of the graphics context, its (00) 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
See also:
paint
Since:
JDK1.0

virtual void java::awt::Component::repaint ( jlong  tm = 0  )  [virtual]

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.

See also:
update(Graphics)
Since:
JDK1.0

virtual void java::awt::Component::repaint ( jint  x,
jint  y,
jint  width,
jint  height,
jlong  tm = 0 
) [virtual]

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:
x the x coordinate
y the y coordinate
width the width
height the height
tm maximum time in milliseconds before update
See also:
update(Graphics)
Since:
JDK1.0

virtual void java::awt::Component::print ( Graphics g  )  [virtual]

Prints this component.

Applications should override this method for components that must do special processing before being printed or should be printed differently than they are painted.

The default implementation of this method calls the paint method.

The origin of the graphics context, its (00) 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
See also:
paint(Graphics)
Since:
JDK1.0

virtual void java::awt::Component::printAll ( Graphics g  )  [virtual]

Prints this component and all of its subcomponents.

The origin of the graphics context, its (00) 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
See also:
print(Graphics)
Since:
JDK1.0

virtual jboolean java::awt::Component::imageUpdate ( const Ref< Image > &  img,
jint  infoflags,
jint  x,
jint  y,
jint  width,
jint  height 
) [virtual]

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.

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.
See also:
java.awt.image.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)

java.awt.image.ImageObserver::imageUpdate(java.awt.Image, int, int, int, int, int)

Since:
JDK1.0

Implements java::awt::image::ImageObserver.

virtual Ref<Image> java::awt::Component::createImage ( const Ref< ImageProducer > &  producer  )  [virtual]

Creates an image from the specified image producer.

Parameters:
producer the image producer
Returns:
the image produced
Since:
JDK1.0

virtual Ref<Image> java::awt::Component::createImage ( jint  width,
jint  height 
) [virtual]

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.
See also:
isDisplayable

GraphicsEnvironment::isHeadless

Since:
JDK1.0

virtual jboolean java::awt::Component::prepareImage ( const Ref< Image > &  image,
jint  width,
jint  height,
const Ref< ImageObserver > &  observer 
) [virtual]

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
See also:
java.awt.image.ImageObserver
Since:
JDK1.0

virtual jint java::awt::Component::checkImage ( const Ref< Image > &  image,
jint  width,
jint  height,
const Ref< ImageObserver > &  observer 
) [virtual]

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
See also:
prepareImage(Image, int, int, java.awt.image.ImageObserver)

Toolkit::checkImage(Image, int, int, java.awt.image.ImageObserver)

java.awt.image.ImageObserver

Since:
JDK1.0

virtual void java::awt::Component::setIgnoreRepaint ( jboolean  ignoreRepaint  )  [virtual]

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:
getIgnoreRepaint

Canvas::createBufferStrategy

Window::createBufferStrategy

java.awt.image.BufferStrategy

GraphicsDevice::setFullScreenWindow

virtual jboolean java::awt::Component::getIgnoreRepaint (  )  const [virtual]

Returns:
whether or not paint messages received from the operating system should be ignored.

Since:
1.4
See also:
setIgnoreRepaint

virtual jboolean java::awt::Component::contains ( jint  x,
jint  y 
) const [virtual]

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
See also:
getComponentAt(int, int)
Since:
JDK1.1

virtual jboolean java::awt::Component::contains ( const Point p  )  const [virtual]

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
See also:
getComponentAt(Point)
Since:
JDK1.1

virtual Ref<Component> java::awt::Component::getComponentAt ( jint  x,
jint  y 
) const [virtual]

Determines if this component or one of its immediate subcomponents contains the (xy) location, and if so, returns the containing component.

This method only looks one level deep. If the point (xy) is inside a subcomponent that itself has subcomponents, it does not go looking down the subcomponent tree.

The locate method of Component simply returns the component itself if the (xy) coordinate location is inside its bounding box, and null otherwise.

Parameters:
x the x coordinate
y the y coordinate
Returns:
the component or subcomponent that contains the (xy) location; null if the location is outside this component
See also:
contains(int, int)
Since:
JDK1.0

virtual Ref<Component> java::awt::Component::getComponentAt ( const Point p  )  const [virtual]

Returns the component or subcomponent that contains the specified point.

Parameters:
p the point
See also:
java.awt.Component::contains
Since:
JDK1.1

virtual void java::awt::Component::addNotify (  )  [virtual]

Makes this Component displayable by connecting it to a native screen resource.

This method is called internally by the toolkit and should not be called directly by programs.

See also:
isDisplayable

removeNotify

Since:
JDK1.0

Reimplemented in java::awt::Container.

virtual void java::awt::Component::removeNotify (  )  [virtual]

Makes this Component undisplayable by destroying it native screen resource.

This method is called by the toolkit internally and should not be called directly by programs.

See also:
isDisplayable

addNotify

Since:
JDK1.0

Reimplemented in java::awt::Container.

virtual void java::awt::Component::dispatchEvent ( AWTEvent e  )  [virtual]

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

Reimplemented in java::awt::Container, and java::awt::Window.

virtual Ref<AWTEvent> java::awt::Component::coalesceEvents ( const Ref< AWTEvent > &  existingEvent,
const Ref< AWTEvent > &  newEvent 
) const [virtual]

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

virtual String java::awt::Component::toString (  )  const [virtual]

Returns a string representation of this component and its values.

Returns:
a string representation of this component
Since:
JDK1.0

Reimplemented from java::lang::Object.

Reimplemented in java::awt::Button, java::awt::Checkbox, java::awt::Choice, java::awt::Container, java::awt::Dialog, java::awt::Frame, java::awt::ListBox, java::awt::Scrollbar, java::awt::TextComponent, and java::awt::Window.

virtual void java::awt::Component::setComponentOrientation ( const ComponentOrientation o  )  [virtual]

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.

See also:
ComponentOrientation
Author:
Laura Werner, IBM bound: true

virtual void java::awt::Component::applyComponentOrientation ( const ComponentOrientation o  )  [virtual]

Sets the ComponentOrientation property of this component and all components contained within it.

Parameters:
orientation the new component orientation of this component and the components contained within it.
Exceptions:
NullPointerException if orientation is null.
See also:
setComponentOrientation

getComponentOrientation

Since:
1.4

Reimplemented in java::awt::Container.

virtual const ComponentOrientation& java::awt::Component::getComponentOrientation (  )  const [virtual]

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
Author:
Laura Werner, IBM

virtual Ref<List> java::awt::Component::getListeners ( const Class type  )  const [virtual]

Returns an array of all the objects currently registered as FooListeners upon this Component.

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 Component c for its mouse listeners with the following code:

MouseListener[] mls = (MouseListener[])(c.getListeners(MouseListener.class));

If no such listeners exist, this method returns an empty array.

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 component, or an empty array if no such listeners have been added
Exceptions:
ClassCastException if listenerType doesn't specify a class or interface that implements java.util.EventListener
See also:
getComponentListeners

getFocusListeners

getHierarchyListeners

getHierarchyBoundsListeners

getKeyListeners

getMouseListeners

getMouseMotionListeners

getMouseWheelListeners

getInputMethodListeners

getPropertyChangeListeners

Since:
1.3

Reimplemented in java::awt::Container, and java::awt::Window.

virtual jboolean java::awt::Component::eventEnabled ( const AWTEvent e  )  const [virtual]

Reimplemented in java::awt::Container, and java::awt::Window.

virtual void java::awt::Component::processEvent ( const AWTEvent e  )  [virtual]

Processes events occurring on this component.

By default this method calls the appropriate process<event type>Event method for the given class of event.

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

Parameters:
e the event
See also:
processComponentEvent

processFocusEvent

processKeyEvent

processMouseEvent

processMouseMotionEvent

processInputMethodEvent

processHierarchyEvent

processMouseWheelEvent

Since:
JDK1.1

Reimplemented in java::awt::Container, and java::awt::Window.

virtual jboolean java::awt::Component::isFocusable (  )  const [virtual]

Returns whether this Component can be focused.

Returns:
true if this Component is focusable; false otherwise.
See also:
setFocusable
Since:
1.4

virtual void java::awt::Component::setFocusable ( jboolean  focusable  )  [virtual]

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
See also:
isFocusable
Since:
1.4 bound: true

virtual void java::awt::Component::requestFocus ( jboolean  temporrary = false  )  [virtual]

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, visible, and focusable 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.

Returns:
false if the focus change request is guaranteed to fail; true if it is likely to succeed
See also:
java.awt.event.FocusEvent

addFocusListener

isFocusable

isDisplayable

KeyboardFocusManager::clearGlobalFocusOwner

Since:
1.4

virtual void java::awt::Component::requestFocusInWindow ( jboolean  temporrary = false  )  [virtual]

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, visible, and focusable 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.

Returns:
false if the focus change request is guaranteed to fail; true if it is likely to succeed
See also:
requestFocus

java.awt.event.FocusEvent

addFocusListener

isFocusable

isDisplayable

KeyboardFocusManager::clearGlobalFocusOwner

Since:
1.4

virtual Ref<Container> java::awt::Component::getFocusCycleRootAncestor (  )  const [virtual]

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
See also:
Container::isFocusCycleRoot()
Since:
1.4

virtual jboolean java::awt::Component::isFocusCycleRoot ( const Ref< Container > &  container  )  const [virtual]

Returns whether the specified Container 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.

Parameters:
container the Container to be tested
Returns:
true if the specified Container is a focus-cycle- root of this Component; false otherwise
See also:
Container::isFocusCycleRoot()
Since:
1.4

Reimplemented in java::awt::Container.

virtual void java::awt::Component::transferFocus (  )  [virtual]

Transfers the focus to the next component, as though this Component were the focus owner.

See also:
requestFocus()
Since:
JDK1.1

virtual void java::awt::Component::transferFocusBackward (  )  [virtual]

Transfers the focus to the previous component, as though this Component were the focus owner.

See also:
requestFocus()
Since:
1.4

virtual void java::awt::Component::transferFocusUpCycle (  )  [virtual]

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.

See also:
requestFocus()

Container::isFocusCycleRoot()

Container::setFocusCycleRoot(boolean)

Since:
1.4

virtual jboolean java::awt::Component::isFocusOwner (  )  const [virtual]

Returns true if this Component is the focus owner.

Returns:
true if this Component is the focus owner; false otherwise
Since:
1.4


Member Data Documentation

const jfloat java::awt::Component::TOP_ALIGNMENT [static]

Ease-of-use constant for getAlignmentY().

Specifies an alignment to the top of the component.

See also:
getAlignmentY

const jfloat java::awt::Component::CENTER_ALIGNMENT [static]

Ease-of-use constant for getAlignmentY and getAlignmentX.

Specifies an alignment to the center of the component

See also:
getAlignmentX

getAlignmentY

const jfloat java::awt::Component::BOTTOM_ALIGNMENT [static]

Ease-of-use constant for getAlignmentY.

Specifies an alignment to the bottom of the component.

See also:
getAlignmentY

const jfloat java::awt::Component::LEFT_ALIGNMENT [static]

Ease-of-use constant for getAlignmentX.

Specifies an alignment to the left side of the component.

See also:
getAlignmentX

const jfloat java::awt::Component::RIGHT_ALIGNMENT [static]

Ease-of-use constant for getAlignmentX.

Specifies an alignment to the right side of the component.

See also:
getAlignmentX

ObjectRef java::awt::Component::impl

Internal Implementation object.

Reimplemented from java::lang::Sync.


The documentation for this class was generated from the following file:
Generated on Fri May 16 11:55:56 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3