java.awt
public abstract class Component extends Object implements ImageObserver, MenuContainer, Serializable
This class is Serializable, which has some big implications. A user can save the state of all graphical components in one VM, and reload them in another. Note that this class will only save Serializable listeners, and ignore the rest, without causing any serialization exceptions. However, by making a listener serializable, and adding it to another element, you link in that entire element to the state of this component. To get around this, use the idiom shown in the example below - make listeners non-serializable in inner classes, rather than using this object itself as the listener, if external objects do not need to save the state of this object.
import java.awt.*; import java.awt.event.*; import java.io.Serializable; class MyApp implements Serializable { BigObjectThatShouldNotBeSerializedWithAButton bigOne; // Serializing aButton will not suck in an instance of MyApp, with its // accompanying field bigOne. Button aButton = new Button(); class MyActionListener implements ActionListener { public void actionPerformed(ActionEvent e) { System.out.println("Hello There"); } } MyApp() { aButton.addActionListener(new MyActionListener()); } }
Status: Incomplete. The event dispatch mechanism is implemented. All other methods defined in the J2SE 1.3 API javadoc exist, but are mostly incomplete or only stubs; except for methods relating to the Drag and Drop, Input Method, and Accessibility frameworks: These methods are present but commented out.
Since: 1.0
UNKNOWN: still missing 1.4 support
Nested Class Summary | |
---|---|
protected abstract class | Component.AccessibleAWTComponent
This class provides accessibility support for subclasses of container.
|
protected class | Component.BltBufferStrategy
This class provides support for blitting offscreen surfaces to a
component.
|
protected class | Component.FlipBufferStrategy
This class provides support for flipping component buffers. |
Field Summary | |
---|---|
static float | BOTTOM_ALIGNMENT
Constant returned by the getAlignmentY method to indicate
that the component wishes to be aligned to the bottom relative to
other components.
|
static float | CENTER_ALIGNMENT
Constant returned by the getAlignmentY and
getAlignmentX methods to indicate
that the component wishes to be aligned to the center relative to
other components.
|
static float | LEFT_ALIGNMENT
Constant returned by the getAlignmentX method to indicate
that the component wishes to be aligned to the left relative to
other components.
|
static float | RIGHT_ALIGNMENT
Constant returned by the getAlignmentX method to indicate
that the component wishes to be aligned to the right relative to
other components.
|
static float | TOP_ALIGNMENT
Constant returned by the getAlignmentY method to indicate
that the component wishes to be aligned to the top relative to
other components.
|
Constructor Summary | |
---|---|
protected | Component()
Default constructor for subclasses. |
Method Summary | |
---|---|
boolean | action(Event evt, Object what)
AWT 1.0 ACTION_EVENT event handler. |
void | add(PopupMenu popup)
Adds the specified popup menu to this component.
|
void | addComponentListener(ComponentListener listener)
Adds the specified listener to this component. |
void | addFocusListener(FocusListener listener)
Adds the specified listener to this component. |
void | addHierarchyBoundsListener(HierarchyBoundsListener listener)
Adds the specified listener to this component. |
void | addHierarchyListener(HierarchyListener listener)
Adds the specified listener to this component. |
void | addInputMethodListener(InputMethodListener listener)
Adds the specified listener to this component. |
void | addKeyListener(KeyListener listener)
Adds the specified listener to this component. |
void | addMouseListener(MouseListener listener)
Adds the specified listener to this component. |
void | addMouseMotionListener(MouseMotionListener listener)
Adds the specified listener to this component. |
void | addMouseWheelListener(MouseWheelListener listener)
Adds the specified listener to this component. |
void | addNotify()
Called when the parent of this Component is made visible or when
the Component is added to an already visible Container and needs
to be shown. |
void | addPropertyChangeListener(PropertyChangeListener listener)
Adds the specified property listener to this component. |
void | addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
Adds the specified property listener to this component. |
void | applyComponentOrientation(ComponentOrientation o)
Sets the text layout orientation of this component. |
boolean | areFocusTraversalKeysSet(int id)
Tests whether the focus traversal keys for a given action are explicitly
set or inherited.
|
Rectangle | bounds()
Returns a bounding rectangle for this component. |
int | checkImage(Image image, ImageObserver observer)
Returns the status of the loading of the specified image. |
int | checkImage(Image image, int width, int height, ImageObserver observer)
Returns the status of the loading of the specified image. |
protected AWTEvent | coalesceEvents(AWTEvent existingEvent, AWTEvent newEvent)
This is called by the EventQueue if two events with the same event id
and owner component are queued. |
boolean | contains(int x, int y)
Tests whether or not the specified point is contained within this
component. |
boolean | contains(Point p)
Tests whether or not the specified point is contained within this
component. |
Image | createImage(ImageProducer producer)
Creates an image from the specified producer.
|
Image | createImage(int width, int height)
Creates an image with the specified width and height for use in
double buffering. |
VolatileImage | createVolatileImage(int width, int height)
Creates an image with the specified width and height for use in
double buffering. |
VolatileImage | createVolatileImage(int width, int height, ImageCapabilities caps)
Creates an image with the specified width and height for use in
double buffering. |
void | deliverEvent(Event e)
AWT 1.0 event delivery.
|
void | disable()
Disables this component.
|
protected void | disableEvents(long eventsToDisable)
Disables the specified events. |
void | dispatchEvent(AWTEvent e)
Forwards AWT events to processEvent() if:
|
void | doLayout()
Calls the layout manager to re-layout the component. |
void | enable()
Enables this component.
|
void | enable(boolean enabled)
Enables or disables this component.
|
protected void | enableEvents(long eventsToEnable)
Enables the specified events. |
void | enableInputMethods(boolean enable)
Enables or disables input method support for this component. |
protected void | firePropertyChange(String propertyName, Object oldValue, Object newValue)
Report a change in a bound property to any registered property listeners.
|
protected void | firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
Report a change in a bound property to any registered property listeners.
|
protected void | firePropertyChange(String propertyName, int oldValue, int newValue)
Report a change in a bound property to any registered property listeners.
|
void | firePropertyChange(String propertyName, byte oldValue, byte newValue)
Report a change in a bound property to any registered property listeners.
|
void | firePropertyChange(String propertyName, char oldValue, char newValue)
Report a change in a bound property to any registered property listeners.
|
void | firePropertyChange(String propertyName, short oldValue, short newValue)
Report a change in a bound property to any registered property listeners.
|
void | firePropertyChange(String propertyName, long oldValue, long newValue)
Report a change in a bound property to any registered property listeners.
|
void | firePropertyChange(String propertyName, float oldValue, float newValue)
Report a change in a bound property to any registered property listeners.
|
void | firePropertyChange(String propertyName, double oldValue, double newValue)
Report a change in a bound property to any registered property listeners.
|
AccessibleContext | getAccessibleContext()
Returns the accessibility framework context of this class. |
float | getAlignmentX()
Returns the preferred horizontal alignment of this component. |
float | getAlignmentY()
Returns the preferred vertical alignment of this component. |
Color | getBackground()
Returns this component's background color. |
Rectangle | getBounds()
Returns a bounding rectangle for this component. |
Rectangle | getBounds(Rectangle r)
Returns the bounds of this component. |
ColorModel | getColorModel()
Returns the color model of the device this componet is displayed on.
|
Component | getComponentAt(int x, int y)
Returns the component occupying the position (x,y). |
Component | getComponentAt(Point p)
Returns the component occupying the position (x,y). |
ComponentListener[] | getComponentListeners()
Returns an array of all specified listeners registered on this component.
|
ComponentOrientation | getComponentOrientation()
Determines the text layout orientation used by this component.
|
Cursor | getCursor()
Returns the cursor for this component. |
DropTarget | getDropTarget()
Gets the associated drag-and-drop target, if there is one.
|
Container | getFocusCycleRootAncestor()
Returns the root container that owns the focus cycle where this
component resides. |
FocusListener[] | getFocusListeners()
Returns an array of all specified listeners registered on this component.
|
Set<AWTKeyStroke> | getFocusTraversalKeys(int id)
Returns the set of keys for a given focus traversal action, as
defined in setFocusTraversalKeys . |
boolean | getFocusTraversalKeysEnabled()
Check whether or not focus traversal keys are enabled on this
Component. |
Font | getFont()
Returns the font in use for this component. |
FontMetrics | getFontMetrics(Font font)
Returns the font metrics for the specified font in this component.
|
Color | getForeground()
Returns this component's foreground color. |
Graphics | getGraphics()
Returns a graphics object for this component. |
GraphicsConfiguration | getGraphicsConfiguration()
Returns the graphics configuration of this component, if there is one.
|
int | getHeight()
Gets the height of the component. |
HierarchyBoundsListener[] | getHierarchyBoundsListeners()
Returns an array of all specified listeners registered on this component.
|
HierarchyListener[] | getHierarchyListeners()
Returns an array of all specified listeners registered on this component.
|
boolean | getIgnoreRepaint()
Test whether paint events from the operating system are ignored.
|
InputContext | getInputContext()
Gets the input context of this component, which is inherited from the
parent unless this is overridden.
|
InputMethodListener[] | getInputMethodListeners()
Returns an array of all specified listeners registered on this component.
|
InputMethodRequests | getInputMethodRequests()
Returns the input method request handler, for subclasses which support
on-the-spot text input. |
KeyListener[] | getKeyListeners()
Returns an array of all specified listeners registered on this component.
|
<T extends EventListener> T[] | getListeners(Class<T> listenerType)
Returns all registered {@link EventListener}s of the given
listenerType .
|
Locale | getLocale()
Returns the locale for this component. |
Point | getLocation()
Returns the location of this component's top left corner relative to
its parent component. |
Point | getLocation(Point p)
Returns the location of this component. |
Point | getLocationOnScreen()
Returns the location of this component's top left corner in screen
coordinates.
|
Dimension | getMaximumSize()
Returns the component's maximum size.
|
Dimension | getMinimumSize()
Returns the component's minimum size.
|
MouseListener[] | getMouseListeners()
Returns an array of all specified listeners registered on this component.
|
MouseMotionListener[] | getMouseMotionListeners()
Returns an array of all specified listeners registered on this component.
|
MouseWheelListener[] | getMouseWheelListeners()
Returns an array of all specified listeners registered on this component.
|
String | getName()
Returns the name of this component.
|
Container | getParent()
Returns the parent of this component.
|
ComponentPeer | getPeer()
Returns the native windowing system peer for this component. |
Dimension | getPreferredSize()
Returns the component's preferred size.
|
PropertyChangeListener[] | getPropertyChangeListeners()
Returns an array of all specified listeners registered on this component.
|
PropertyChangeListener[] | getPropertyChangeListeners(String property)
Returns an array of all specified listeners on the named property that
are registered on this component.
|
Dimension | getSize()
Returns the size of this object.
|
Dimension | getSize(Dimension d)
Returns the size of this component. |
Toolkit | getToolkit()
Returns the toolkit in use for this component. |
Object | getTreeLock()
Returns the object used for synchronization locks on this component
when performing tree and layout functions.
|
int | getWidth()
Gets the width of the component. |
int | getX()
Gets the x coordinate of the upper left corner. |
int | getY()
Gets the y coordinate of the upper left corner. |
boolean | gotFocus(Event evt, Object what)
AWT 1.0 GOT_FOCUS event handler. |
boolean | handleEvent(Event evt)
AWT 1.0 event handler.
|
boolean | hasFocus()
Tests if this component is the focus owner. |
void | hide()
Hides this component so that it is no longer shown on the screen.
|
boolean | imageUpdate(Image img, int flags, int x, int y, int w, int h)
Called when an image has changed so that this component is repainted.
|
boolean | inside(int x, int y)
Tests whether or not the specified point is contained within this
component. |
void | invalidate()
Invalidates this component and all of its parent components. |
boolean | isBackgroundSet()
Tests if the background was explicitly set, or just inherited from the
parent.
|
boolean | isCursorSet()
Tests if the cursor was explicitly set, or just inherited from the parent.
|
boolean | isDisplayable()
Tests if the component is displayable. |
boolean | isDoubleBuffered()
Checks if this image is painted to an offscreen image buffer that is
later copied to screen (double buffering reduces flicker). |
boolean | isEnabled()
Tests whether or not this component is enabled. |
boolean | isFocusable()
Tests if this component can receive focus.
|
boolean | isFocusCycleRoot(Container c)
Tests if the container is the ancestor of the focus cycle that
this component belongs to.
|
boolean | isFocusOwner()
Tests if this component is the focus owner.
|
boolean | isFocusTraversable()
Tests whether or not this component is in the group that can be
traversed using the keyboard traversal mechanism (such as the TAB key).
|
boolean | isFontSet()
Tests if the font was explicitly set, or just inherited from the parent.
|
boolean | isForegroundSet()
Tests if the foreground was explicitly set, or just inherited from the
parent.
|
boolean | isLightweight()
Return whether the component is lightweight. |
boolean | isMaximumSizeSet()
Returns true if the current maximum size is not
null and was set by a call to
{@link #setMaximumSize(Dimension)}, otherwise returns false .
|
boolean | isMinimumSizeSet()
Returns true if the current minimum size is not
null and was set by a call to
{@link #setMinimumSize(Dimension)}, otherwise returns false .
|
boolean | isOpaque()
Tests if this component is opaque. |
boolean | isPreferredSizeSet()
Returns true if the current preferred size is not
null and was set by a call to
{@link #setPreferredSize(Dimension)}, otherwise returns false .
|
boolean | isShowing()
Tests whether or not this component is actually being shown on
the screen. |
boolean | isValid()
Tests whether or not this component is valid. |
boolean | isVisible()
Tests whether or not this component is visible. |
boolean | keyDown(Event evt, int key)
AWT 1.0 KEY_PRESS and KEY_ACTION event handler. |
boolean | keyUp(Event evt, int key)
AWT 1.0 KEY_RELEASE and KEY_ACTION_RELEASE event handler. |
void | layout()
Calls the layout manager to re-layout the component. |
void | list()
Prints a listing of this component to System.out .
|
void | list(PrintStream out)
Prints a listing of this component to the specified print stream.
|
void | list(PrintStream out, int indent)
Prints a listing of this component to the specified print stream,
starting at the specified indentation point.
|
void | list(PrintWriter out)
Prints a listing of this component to the specified print writer.
|
void | list(PrintWriter out, int indent)
Prints a listing of this component to the specified print writer,
starting at the specified indentation point.
|
Component | locate(int x, int y)
Returns the component occupying the position (x,y). |
Point | location()
Returns the location of this component's top left corner relative to
its parent component.
|
boolean | lostFocus(Event evt, Object what)
AWT 1.0 LOST_FOCUS event handler. |
Dimension | minimumSize()
Returns the component's minimum size.
|
boolean | mouseDown(Event evt, int x, int y)
AWT 1.0 MOUSE_DOWN event handler. |
boolean | mouseDrag(Event evt, int x, int y)
AWT 1.0 MOUSE_DRAG event handler. |
boolean | mouseEnter(Event evt, int x, int y)
AWT 1.0 MOUSE_ENTER event handler. |
boolean | mouseExit(Event evt, int x, int y)
AWT 1.0 MOUSE_EXIT event handler. |
boolean | mouseMove(Event evt, int x, int y)
AWT 1.0 MOUSE_MOVE event handler. |
boolean | mouseUp(Event evt, int x, int y)
AWT 1.0 MOUSE_UP event handler. |
void | move(int x, int y)
Moves this component to the specified location, relative to the parent's
coordinates. |
void | nextFocus()
AWT 1.0 focus event processor. |
void | paint(Graphics g)
Paints this component on the screen. |
void | paintAll(Graphics g)
Paints this entire component, including any sub-components.
|
protected String | paramString()
Returns a debugging string representing this component. |
boolean | postEvent(Event e)
AWT 1.0 event handler.
|
Dimension | preferredSize()
Returns the component's preferred size.
|
boolean | prepareImage(Image image, ImageObserver observer)
Prepares the specified image for rendering on this component.
|
boolean | prepareImage(Image image, int width, int height, ImageObserver observer)
Prepares the specified image for rendering on this component at the
specified scaled width and height
|
void | print(Graphics g)
Prints this component. |
void | printAll(Graphics g)
Prints this component, including all sub-components.
|
protected void | processComponentEvent(ComponentEvent e)
Called when a component event is dispatched and component events are
enabled. |
protected void | processEvent(AWTEvent e)
Processes the specified event. |
protected void | processFocusEvent(FocusEvent e)
Called when a focus event is dispatched and component events are
enabled. |
protected void | processHierarchyBoundsEvent(HierarchyEvent e)
Called when a hierarchy bounds event is dispatched and component events
are enabled. |
protected void | processHierarchyEvent(HierarchyEvent e)
Called when a hierarchy change event is dispatched and component events
are enabled. |
protected void | processInputMethodEvent(InputMethodEvent e)
Called when an input method event is dispatched and component events are
enabled. |
protected void | processKeyEvent(KeyEvent e)
Called when a key event is dispatched and component events are
enabled. |
protected void | processMouseEvent(MouseEvent e)
Called when a regular mouse event is dispatched and component events are
enabled. |
protected void | processMouseMotionEvent(MouseEvent e)
Called when a mouse motion event is dispatched and component events are
enabled. |
protected void | processMouseWheelEvent(MouseWheelEvent e)
Called when a mouse wheel event is dispatched and component events are
enabled. |
void | remove(MenuComponent popup)
Removes the specified popup menu from this component.
|
void | removeComponentListener(ComponentListener listener)
Removes the specified listener from the component. |
void | removeFocusListener(FocusListener listener)
Removes the specified listener from the component. |
void | removeHierarchyBoundsListener(HierarchyBoundsListener listener)
Removes the specified listener from the component. |
void | removeHierarchyListener(HierarchyListener listener)
Removes the specified listener from the component. |
void | removeInputMethodListener(InputMethodListener listener)
Removes the specified listener from the component. |
void | removeKeyListener(KeyListener listener)
Removes the specified listener from the component. |
void | removeMouseListener(MouseListener listener)
Removes the specified listener from the component. |
void | removeMouseMotionListener(MouseMotionListener listener)
Removes the specified listener from the component. |
void | removeMouseWheelListener(MouseWheelListener listener)
Removes the specified listener from the component. |
void | removeNotify()
Called to inform this component is has been removed from its
container. |
void | removePropertyChangeListener(PropertyChangeListener listener)
Removes the specified property listener from the component. |
void | removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
Removes the specified property listener on a particular property from
the component. |
void | repaint()
Repaint this entire component. |
void | repaint(long tm)
Repaint this entire component. |
void | repaint(int x, int y, int w, int h)
Repaints the specified rectangular region within this component. |
void | repaint(long tm, int x, int y, int width, int height)
Repaints the specified rectangular region within this component. |
void | requestFocus()
Request that this Component be given the keyboard input focus and
that its top-level ancestor become the focused Window.
|
protected boolean | requestFocus(boolean temporary)
Request that this Component be given the keyboard input focus and
that its top-level ancestor become the focused Window.
|
boolean | requestFocusInWindow()
Request that this component be given the keyboard input focus, if
its top-level ancestor is the currently focused Window. |
protected boolean | requestFocusInWindow(boolean temporary)
Request that this component be given the keyboard input focus, if
its top-level ancestor is the currently focused Window. |
void | reshape(int x, int y, int width, int height)
Sets the bounding rectangle for this component to the specified values.
|
void | resize(int width, int height)
Sets the size of this component to the specified value.
|
void | resize(Dimension d)
Sets the size of this component to the specified value.
|
void | setBackground(Color c)
Sets this component's background color to the specified color. |
void | setBounds(int x, int y, int w, int h)
Sets the bounding rectangle for this component to the specified values.
|
void | setBounds(Rectangle r)
Sets the bounding rectangle for this component to the specified
rectangle. |
void | setComponentOrientation(ComponentOrientation o)
Sets the text layout orientation of this component. |
void | setCursor(Cursor cursor)
Sets the cursor for this component to the specified cursor. |
void | setDropTarget(DropTarget dt)
Set the associated drag-and-drop target, which receives events when this
is enabled.
|
void | setEnabled(boolean enabled)
Enables or disables this component. |
void | setFocusable(boolean focusable)
Specify whether this component can receive focus. |
void | setFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes)
Sets the focus traversal keys for one of the three focus
traversal directions supported by Components:
{@link KeyboardFocusManager#FORWARD_TRAVERSAL_KEYS},
{@link KeyboardFocusManager#BACKWARD_TRAVERSAL_KEYS}, or
{@link KeyboardFocusManager#UP_CYCLE_TRAVERSAL_KEYS}. |
void | setFocusTraversalKeysEnabled(boolean focusTraversalKeysEnabled)
Enable or disable focus traversal keys on this Component. |
void | setFont(Font f)
Sets the font for this component to the specified font. |
void | setForeground(Color c)
Sets this component's foreground color to the specified color. |
void | setIgnoreRepaint(boolean ignoreRepaint)
Sets whether paint messages delivered by the operating system should be
ignored. |
void | setLocale(Locale newLocale)
Sets the locale for this component to the specified locale. |
void | setLocation(int x, int y)
Moves this component to the specified location, relative to the parent's
coordinates. |
void | setLocation(Point p)
Moves this component to the specified location, relative to the parent's
coordinates. |
void | setMaximumSize(Dimension size)
Sets the maximum size that will be returned by {@link #getMaximumSize()}
always, and sends a {@link PropertyChangeEvent} (with the property name
'maximumSize') to all registered listeners.
|
void | setMinimumSize(Dimension size)
Sets the minimum size that will be returned by {@link #getMinimumSize()}
always, and sends a {@link PropertyChangeEvent} (with the property name
'minimumSize') to all registered listeners.
|
void | setName(String name)
Sets the name of this component to the specified name (this is a bound
property with the name 'name').
|
void | setPreferredSize(Dimension size)
Sets the preferred size that will be returned by
{@link #getPreferredSize()} always, and sends a
{@link PropertyChangeEvent} (with the property name 'preferredSize') to
all registered listeners.
|
void | setSize(int width, int height)
Sets the size of this component to the specified width and height.
|
void | setSize(Dimension d)
Sets the size of this component to the specified value.
|
void | setVisible(boolean visible)
Makes this component visible or invisible. |
void | show()
Makes this component visible on the screen.
|
void | show(boolean visible)
Makes this component visible or invisible.
|
Dimension | size()
Returns the size of this object.
|
String | toString()
Returns a string representation of this component. |
void | transferFocus()
Transfers focus to the next component in the focus traversal
order, as though this were the current focus owner.
|
void | transferFocusBackward()
Transfers focus to the previous component in the focus traversal
order, as though this were the current focus owner.
|
void | transferFocusUpCycle()
Transfers focus to the focus cycle root of this component.
|
void | update(Graphics g)
Updates this component. |
void | validate()
Called to ensure that the layout for this component is valid. |
getAlignmentY
method to indicate
that the component wishes to be aligned to the bottom relative to
other components.
See Also: getAlignmentY
getAlignmentY
and
getAlignmentX
methods to indicate
that the component wishes to be aligned to the center relative to
other components.
See Also: getAlignmentX getAlignmentY
getAlignmentX
method to indicate
that the component wishes to be aligned to the left relative to
other components.
See Also: getAlignmentX
getAlignmentX
method to indicate
that the component wishes to be aligned to the right relative to
other components.
See Also: getAlignmentX
getAlignmentY
method to indicate
that the component wishes to be aligned to the top relative to
other components.
See Also: getAlignmentY
Deprecated: in classes which support actions, use
processActionEvent(ActionEvent)
instead
Parameters: evt the event to handle what the object acted on, ignored
Returns: false
Parameters: popup the popup menu to be added
Since: 1.1
Parameters: listener the new listener to add
Since: 1.1
See Also: ComponentEvent removeComponentListener getComponentListeners
Parameters: listener the new listener to add
Since: 1.1
See Also: FocusEvent removeFocusListener getFocusListeners
Parameters: listener the new listener to add
Since: 1.3
See Also: HierarchyEvent removeHierarchyBoundsListener getHierarchyBoundsListeners
Parameters: listener the new listener to add
Since: 1.3
See Also: HierarchyEvent removeHierarchyListener getHierarchyListeners
Parameters: listener the new listener to add
Since: 1.2
See Also: InputMethodEvent removeInputMethodListener getInputMethodListeners getInputMethodRequests
Parameters: listener the new listener to add
Since: 1.1
See Also: KeyEvent removeKeyListener getKeyListeners
Parameters: listener the new listener to add
Since: 1.1
See Also: MouseEvent removeMouseListener getMouseListeners
Parameters: listener the new listener to add
Since: 1.1
See Also: MouseEvent removeMouseMotionListener getMouseMotionListeners
Parameters: listener the new listener to add
Since: 1.4
See Also: MouseEvent MouseWheelEvent removeMouseWheelListener getMouseWheelListeners
See Also: isDisplayable removeNotify
"font"
)"background"
)"foreground"
)"focusable"
)"focusTraversalKeysEnabled"
)"forwardFocusTraversalKeys"
)"backwardFocusTraversalKeys"
)"upCycleFocusTraversalKeys"
)Parameters: listener the new listener to add
Since: 1.1
See Also: removePropertyChangeListener getPropertyChangeListeners Component
"font"
)"background"
)"foreground"
)"focusable"
)"focusTraversalKeysEnabled"
)"forwardFocusTraversalKeys"
)"backwardFocusTraversalKeys"
)"upCycleFocusTraversalKeys"
)Parameters: propertyName the property name to filter on listener the new listener to add
Since: 1.1
See Also: Component getPropertyChangeListeners addPropertyChangeListener
Parameters: o the new orientation
Throws: NullPointerException if o is null
Since: 1.4
See Also: getComponentOrientation
Parameters: id one of FORWARD_TRAVERSAL_KEYS, BACKWARD_TRAVERSAL_KEYS, or UP_CYCLE_TRAVERSAL_KEYS
Returns: true if that set is explicitly specified
Throws: IllegalArgumentException if id is invalid
Since: 1.4
See Also: Component FORWARD_TRAVERSAL_KEYS BACKWARD_TRAVERSAL_KEYS UP_CYCLE_TRAVERSAL_KEYS
Deprecated: use {@link #getBounds()} instead
Returns a bounding rectangle for this component. Note that the returned rectange is relative to this component's parent, not to the screen.Returns: the bounding rectangle for this component
ImageObserver
.
Parameters: image the image to check on observer the observer to notify of image loading progress
Returns: the image observer flags indicating the status of the load
Throws: NullPointerException if image is null
ImageObserver
.
Parameters: image the image to check on width the scaled image width height the scaled image height observer the observer to notify of image loading progress
Returns: the image observer flags indicating the status of the load
Parameters: existingEvent the event on the queue newEvent the new event that might be entered on the queue
Returns: null if both events are kept, or the replacement coelesced event
Parameters: x the X coordinate of the point to test y the Y coordinate of the point to test
Returns: true if the point is within this component
See Also: Component
Parameters: p the point to test
Returns: true if the point is within this component
Throws: NullPointerException if p is null
Since: 1.1
See Also: getComponentAt
Parameters: producer the image procedure to create the image from
Returns: the resulting image
Parameters: width the width of the image height the height of the image
Returns: the requested image, or null if it is not supported
Parameters: width the width of the image height the height of the image
Returns: the requested image, or null if it is not supported
Since: 1.4
Parameters: width the width of the image height the height of the image caps the requested capabilities
Returns: the requested image, or null if it is not supported
Throws: AWTException if a buffer with the capabilities cannot be created
Since: 1.4
Deprecated: use {@link #dispatchEvent (AWTEvent)} instead
AWT 1.0 event delivery. Deliver an AWT 1.0 event to this Component. This method simply calls {@link #postEvent}.Parameters: e the event to deliver
Deprecated: use {@link #setEnabled(boolean)} instead
Disables this component.AWTEvent
.
Parameters: eventsToDisable the desired events to disable
Since: 1.1
See Also: Component
enableEvents()
Parameters: e the event to dispatch
See Also: validate LayoutManager
Deprecated: use {@link #setEnabled(boolean)} instead
Enables this component.Deprecated: use {@link #setEnabled(boolean)} instead
Enables or disables this component.Parameters: enabled true to enable this component
AWTEvent
.
Events are enabled by default when a listener is attached to the component for that event type. This method can be used by subclasses to ensure the delivery of a specified event regardless of whether or not a listener is attached.
Parameters: eventsToEnable the desired events to enable
Since: 1.1
See Also: processEvent Component AWTEvent
Parameters: enable true to enable input method processing
Since: 1.2
See Also: processKeyEvent
Parameters: propertyName the property that changed oldValue the old property value newValue the new property value
Parameters: propertyName the property that changed oldValue the old property value newValue the new property value
Parameters: propertyName the property that changed oldValue the old property value newValue the new property value
Parameters: propertyName the property that changed oldValue the old property value newValue the new property value
Since: 1.5
Parameters: propertyName the property that changed oldValue the old property value newValue the new property value
Since: 1.5
Parameters: propertyName the property that changed oldValue the old property value newValue the new property value
Since: 1.5
Parameters: propertyName the property that changed oldValue the old property value newValue the new property value
Since: 1.5
Parameters: propertyName the property that changed oldValue the old property value newValue the new property value
Since: 1.5
Parameters: propertyName the property that changed oldValue the old property value newValue the new property value
Since: 1.5
Returns: the accessibility context
Returns: the preferred horizontal alignment of this component
Returns: the preferred vertical alignment of this component
Returns: the background color of the component, or null
See Also: setBackground
Returns: the bounding rectangle for this component
See Also: Component getLocation getSize
Parameters: r the rectangle to use, or null
Returns: the bounds
Returns: this object's color model
See Also: getColorModel
null
if neither of the first two occupies the specified location.
Parameters: x the X coordinate to search for components at y the Y coordinate to search for components at
Returns: the component at the specified location, or null
See Also: Component
null
if neither of the first two occupies the specified location.
Parameters: p the point to search for components at
Returns: the component at the specified location, or null
Throws: NullPointerException if p is null
Since: 1.1
See Also: contains
Returns: an array of listeners
Since: 1.4
See Also: addComponentListener removeComponentListener
Returns: the component orientation (this can be null
)
See Also: setComponentOrientation
Returns: the cursor for this component
Returns: the drop target
Returns: the ancestor container that owns the focus cycle
Since: 1.4
Returns: an array of listeners
Since: 1.4
See Also: addFocusListener removeFocusListener
setFocusTraversalKeys
. If not set, this
is inherited from the parent component, which may have gotten it
from the KeyboardFocusManager.
Parameters: id one of FORWARD_TRAVERSAL_KEYS, BACKWARD_TRAVERSAL_KEYS, or UP_CYCLE_TRAVERSAL_KEYS
Returns: set of traversal keys
Throws: IllegalArgumentException if id is invalid
Since: 1.4
See Also: Component FORWARD_TRAVERSAL_KEYS BACKWARD_TRAVERSAL_KEYS UP_CYCLE_TRAVERSAL_KEYS
Returns: true if focus traversal keys are enabled
Since: 1.4
Returns: the font for this component
See Also: setFont
Parameters: font the font to retrieve metrics for
Returns: the font metrics for the specified font
Throws: NullPointerException if font is null
See Also: getFont getFontMetrics
Returns: this component's foreground color, or null
See Also: setForeground
null
if this component is not currently displayed on the screen.
Returns: a graphics object for this component
See Also: paint
Returns: the graphics configuration, or null
Since: 1.3
Returns: the current width
Since: 1.2
Returns: an array of listeners
Since: 1.4
See Also: addHierarchyBoundsListener removeHierarchyBoundsListener
Returns: an array of listeners
Since: 1.4
See Also: addHierarchyListener removeHierarchyListener
Returns: the status of ignoring paint events
Since: 1.4
See Also: Component
Returns: the text input context
Since: 1.2
Returns: an array of listeners
Since: 1.4
Returns: the input method handler, null by default
Since: 1.2
Returns: an array of listeners
Since: 1.4
See Also: addKeyListener removeKeyListener
listenerType
.
Parameters: listenerType the class of listeners to filter (null
not permitted).
Returns: An array of registered listeners.
Throws: ClassCastException if listenerType
does not implement
the {@link EventListener} interface. NullPointerException if listenerType
is
null
.
Since: 1.3
See Also: getComponentListeners getFocusListeners getHierarchyListeners getHierarchyBoundsListeners getKeyListeners getMouseListeners getMouseMotionListeners getMouseWheelListeners getInputMethodListeners getPropertyChangeListeners
Returns: the locale for this component
Throws: IllegalComponentStateException if it has no locale or parent
Since: 1.1
See Also: setLocale
Returns: the location of this component
Since: 1.1
See Also: Component getLocationOnScreen
Parameters: p the point to use, or null
Returns: the location
Returns: the location of this component in screen coordinates
Throws: IllegalComponentStateException if the component is not showing
Returns: the component's maximum size
See Also: getMinimumSize setMaximumSize getPreferredSize LayoutManager
Returns: the component's minimum size
See Also: getPreferredSize setMinimumSize LayoutManager
Returns: an array of listeners
Since: 1.4
See Also: addMouseListener removeMouseListener
Returns: an array of listeners
Since: 1.4
Returns: an array of listeners
Since: 1.4
Returns: the name of this component
Since: 1.1
See Also: setName
Returns: the parent of this component
Deprecated: user programs should not directly manipulate peers; use {@link #isDisplayable()} instead
Returns the native windowing system peer for this component. Only the platform specific implementation code should call this method.Returns: the peer for this component
Returns: the component's preferred size
See Also: getMinimumSize setPreferredSize LayoutManager
Returns: an array of listeners
Since: 1.4
See Also: addPropertyChangeListener removePropertyChangeListener getPropertyChangeListeners
Returns: an array of listeners
Since: 1.4
See Also: Component Component getPropertyChangeListeners
Parameters: d the dimension to use, or null
Returns: the size
Returns: the toolkit for this component
Returns: the synchronization lock for this component
Returns: the current width
Since: 1.2
Returns: the current x coordinate
Since: 1.2
Returns: the current y coordinate
Since: 1.2
Deprecated: use {@link #processFocusEvent(FocusEvent)} instead
AWT 1.0 GOT_FOCUS event handler. This method is meant to be overridden by components providing their own GOT_FOCUS handler. The default implementation simply returns false.Parameters: evt the event to handle what the Object focused, ignored
Returns: false
Deprecated: use {@link #processEvent(AWTEvent)} instead
AWT 1.0 event handler. This method calls one of the event-specific handler methods. For example for key events, either {@link #keyDown(Event,int)} or {@link #keyUp(Event,int)} is called. A derived component can override one of these event-specific methods if it only needs to handle certain event types. Otherwise it can override handleEvent itself and handle any event.Parameters: evt the event to handle
Returns: true if the event was handled, false otherwise
Returns: true if this component owns focus
Since: 1.2
Deprecated: use {@link #setVisible(boolean)} instead
Hides this component so that it is no longer shown on the screen.awt.image.incrementalDraw
is not present or is true, in which
case the redraw rate is set to 100ms or the value of the system property
awt.image.redrawrate
.
The coordinate system used depends on the particular flags.
Parameters: img the image that has been updated flags tlags as specified in ImageObserver
x the X coordinate y the Y coordinate w the width h the height
Returns: false if the image is completely loaded, loading has been aborted, or an error has occurred. true if more updates are required.
See Also: ImageObserver Graphics Graphics Graphics Graphics ImageObserver
Deprecated: use {@link #contains(int, int)} instead
Tests whether or not the specified point is contained within this component. Coordinates are relative to this component.Parameters: x the X coordinate of the point to test y the Y coordinate of the point to test
Returns: true if the point is within this component
Returns: true if the background has been set
Since: 1.4
Returns: true if the cursor has been set
Since: 1.4
Returns: true if the component is displayable
Since: 1.2
Returns: true if this is double buffered; defaults to false
Returns: true if the component is enabled
See Also: Component
Returns: true if this component can receive focus
Since: 1.4
Parameters: c the container to test
Returns: true if c is the focus cycle root
Since: 1.4
Returns: true if this component owns focus
Since: 1.4
Deprecated: use {@link #isFocusable()} instead
Tests whether or not this component is in the group that can be traversed using the keyboard traversal mechanism (such as the TAB key).Returns: true if the component is traversed via the TAB key
Since: 1.1
See Also: Component
Returns: true if the font has been set
Since: 1.4
Returns: true if the foreground has been set
Since: 1.4
Returns: true if the component has a lightweight peer
Since: 1.2
See Also: isDisplayable
true
if the current maximum size is not
null
and was set by a call to
{@link #setMaximumSize(Dimension)}, otherwise returns false
.
Returns: A boolean.
Since: 1.5
true
if the current minimum size is not
null
and was set by a call to
{@link #setMinimumSize(Dimension)}, otherwise returns false
.
Returns: A boolean.
Since: 1.5
Returns: true if this is opaque
Since: 1.2
See Also: isLightweight
true
if the current preferred size is not
null
and was set by a call to
{@link #setPreferredSize(Dimension)}, otherwise returns false
.
Returns: A boolean.
Since: 1.5
Returns: true if the component is showing on the screen
See Also: Component
Returns: true if this component is valid
See Also: validate invalidate
Returns: true if the component is visible
See Also: Component
Deprecated: use {@link #processKeyEvent(KeyEvent)} instead
AWT 1.0 KEY_PRESS and KEY_ACTION event handler. This method is meant to be overridden by components providing their own key press handler. The default implementation simply returns false.Parameters: evt the event to handle key the key pressed, ignored
Returns: false
Deprecated: use {@link #processKeyEvent(KeyEvent)} instead
AWT 1.0 KEY_RELEASE and KEY_ACTION_RELEASE event handler. This method is meant to be overridden by components providing their own key release handler. The default implementation simply returns false.Parameters: evt the event to handle key the key pressed, ignored
Returns: false
Deprecated: use {@link #doLayout()} instead
Calls the layout manager to re-layout the component. This is called during validation of a container in most cases.System.out
.
See Also: list
Parameters: out the PrintStream
to print to
Parameters: out the PrintStream
to print to indent the indentation point
Parameters: out the PrintWrinter
to print to
Since: 1.1
Parameters: out the PrintWriter
to print to indent the indentation point
Since: 1.1
Deprecated: use {@link #getComponentAt(int, int)} instead
Returns the component occupying the position (x,y). This will either be this component, an immediate child component, ornull
if neither of the first two occupies the specified location.
Parameters: x the X coordinate to search for components at y the Y coordinate to search for components at
Returns: the component at the specified location, or null
Deprecated: use {@link #getLocation()} instead
Returns the location of this component's top left corner relative to its parent component.Returns: the location of this component
Deprecated: use {@link #processFocusEvent(FocusEvent)} instead
AWT 1.0 LOST_FOCUS event handler. This method is meant to be overridden by components providing their own LOST_FOCUS handler. The default implementation simply returns false.Parameters: evt the event to handle what the Object focused, ignored
Returns: false
Deprecated: use {@link #getMinimumSize()} instead
Returns the component's minimum size.Returns: the component's minimum size
Deprecated: use {@link #processMouseEvent(MouseEvent)} instead
AWT 1.0 MOUSE_DOWN event handler. This method is meant to be overridden by components providing their own MOUSE_DOWN handler. The default implementation simply returns false.Parameters: evt the event to handle x the x coordinate, ignored y the y coordinate, ignored
Returns: false
Deprecated: use {@link #processMouseMotionEvent(MouseEvent)} instead
AWT 1.0 MOUSE_DRAG event handler. This method is meant to be overridden by components providing their own MOUSE_DRAG handler. The default implementation simply returns false.Parameters: evt the event to handle x the x coordinate, ignored y the y coordinate, ignored
Returns: false
Deprecated: use {@link #processMouseEvent(MouseEvent)} instead
AWT 1.0 MOUSE_ENTER event handler. This method is meant to be overridden by components providing their own MOUSE_ENTER handler. The default implementation simply returns false.Parameters: evt the event to handle x the x coordinate, ignored y the y coordinate, ignored
Returns: false
Deprecated: use {@link #processMouseEvent(MouseEvent)} instead
AWT 1.0 MOUSE_EXIT event handler. This method is meant to be overridden by components providing their own MOUSE_EXIT handler. The default implementation simply returns false.Parameters: evt the event to handle x the x coordinate, ignored y the y coordinate, ignored
Returns: false
Deprecated: use {@link #processMouseMotionEvent(MouseEvent)} instead
AWT 1.0 MOUSE_MOVE event handler. This method is meant to be overridden by components providing their own MOUSE_MOVE handler. The default implementation simply returns false.Parameters: evt the event to handle x the x coordinate, ignored y the y coordinate, ignored
Returns: false
Deprecated: use {@link #processMouseEvent(MouseEvent)} instead
AWT 1.0 MOUSE_UP event handler. This method is meant to be overridden by components providing their own MOUSE_UP handler. The default implementation simply returns false.Parameters: evt the event to handle x the x coordinate, ignored y the y coordinate, ignored
Returns: false
Deprecated: use {@link #setLocation(int, int)} instead
Moves this component to the specified location, relative to the parent's coordinates. The coordinates are the new upper left corner of this component.Parameters: x the new X coordinate of this component y the new Y coordinate of this component
Deprecated: use {@link #transferFocus ()} instead
AWT 1.0 focus event processor. Transfers focus to the next component in the focus traversal order, as though this were the current focus owner.super.paint(g)
. Components with no area
are not painted.
Parameters: g the graphics context for this paint job
See Also: update
Parameters: g the graphics context for this paint job
See Also: paint
Returns: a string representing this component
Deprecated: use {@link #dispatchEvent(AWTEvent)} instead
AWT 1.0 event handler. This method simply calls handleEvent and returns the result.Parameters: e the event to handle
Returns: true if the event was handled, false otherwise
Deprecated: use {@link #getPreferredSize()} instead
Returns the component's preferred size.Returns: the component's preferred size
Parameters: image the image to prepare for rendering observer the observer to notify of image preparation status
Returns: true if the image is already fully prepared
Throws: NullPointerException if image is null
Parameters: image the image to prepare for rendering width the scaled width of the image height the scaled height of the image observer the observer to notify of image preparation status
Returns: true if the image is already fully prepared
paint()
method.
Parameters: g the graphics context of the print device
See Also: paint
Parameters: g the graphics context of the print device
See Also: paintAll
Parameters: e the ComponentEvent
to process
Throws: NullPointerException if e is null
Since: 1.1
See Also: ComponentListener addComponentListener Component
Parameters: e the event to process
Throws: NullPointerException if e is null
Since: 1.1
See Also: processComponentEvent processFocusEvent processKeyEvent processMouseEvent processMouseMotionEvent processInputMethodEvent processHierarchyEvent processMouseWheelEvent
Parameters: e the FocusEvent
to process
Throws: NullPointerException if e is null
Since: 1.1
See Also: FocusListener addFocusListener Component
Parameters: e the HierarchyEvent
to process
Throws: NullPointerException if e is null
Since: 1.3
See Also: HierarchyBoundsListener addHierarchyBoundsListener Component
Parameters: e the HierarchyEvent
to process
Throws: NullPointerException if e is null
Since: 1.3
See Also: HierarchyListener addHierarchyListener Component
Parameters: e the InputMethodEvent
to process
Throws: NullPointerException if e is null
Since: 1.2
See Also: InputMethodListener addInputMethodListener Component
Parameters: e the KeyEvent
to process
Throws: NullPointerException if e is null
Since: 1.1
See Also: KeyListener addKeyListener Component
Parameters: e the MouseEvent
to process
Throws: NullPointerException if e is null
Since: 1.1
See Also: MouseListener addMouseListener Component
Parameters: e the MouseMotionEvent
to process
Throws: NullPointerException if e is null
Since: 1.1
See Also: MouseMotionListener addMouseMotionListener Component
Parameters: e the MouseWheelEvent
to process
Throws: NullPointerException if e is null
Since: 1.4
See Also: MouseWheelListener addMouseWheelListener Component
Parameters: popup the popup menu to remove
Since: 1.1
See Also: add
Parameters: listener the listener to remove
Since: 1.1
See Also: ComponentEvent addComponentListener getComponentListeners
Parameters: listener the listener to remove
Since: 1.1
See Also: FocusEvent addFocusListener getFocusListeners
Parameters: listener the listener to remove
Since: 1.3
See Also: HierarchyEvent addHierarchyBoundsListener getHierarchyBoundsListeners
Parameters: listener the listener to remove
Since: 1.3
See Also: HierarchyEvent addHierarchyListener getHierarchyListeners
Parameters: listener the listener to remove
Since: 1.2
See Also: InputMethodEvent addInputMethodListener getInputMethodRequests
Parameters: listener the listener to remove
Since: 1.1
See Also: KeyEvent addKeyListener getKeyListeners
Parameters: listener the listener to remove
Since: 1.1
See Also: MouseEvent addMouseListener getMouseListeners
Parameters: listener the listener to remove
Since: 1.1
See Also: MouseEvent addMouseMotionListener getMouseMotionListeners
Parameters: listener the listener to remove
Since: 1.4
See Also: MouseEvent MouseWheelEvent addMouseWheelListener getMouseWheelListeners
See Also: isDisplayable addNotify
Parameters: listener the listener to remove
Since: 1.1
See Also: addPropertyChangeListener getPropertyChangeListeners Component
Parameters: propertyName the property name to filter on listener the listener to remove
Since: 1.1
See Also: Component getPropertyChangeListeners removePropertyChangeListener
update()
method
on this component will be called as soon as possible.
update()
method on this
component will be called in approximate the specified number of
milliseconds.
Parameters: tm milliseconds before this component should be repainted
update
method on this component will be called as soon as
possible. The coordinates are relative to this component.
Parameters: x the X coordinate of the upper left of the region to repaint y the Y coordinate of the upper left of the region to repaint w the width of the region to repaint h the height of the region to repaint
update
method on this component will be called in
approximately the specified number of milliseconds. The coordinates
are relative to this component.
Parameters: tm milliseconds before this component should be repainted x the X coordinate of the upper left of the region to repaint y the Y coordinate of the upper left of the region to repaint width the width of the region to repaint height the height of the region to repaint
See Also: update
See Also: requestFocusInWindow FocusEvent addFocusListener isFocusable isDisplayable clearGlobalFocusOwner
Parameters: temporary true if the focus request is temporary
Returns: true if the request has a chance of success
Since: 1.4
See Also: requestFocusInWindow FocusEvent addFocusListener isFocusable isDisplayable clearGlobalFocusOwner
FOCUS_GAINED
event will be fired if and only if this
request is successful. To be successful, the component must be
displayable, showing, and focusable, and its ancestor top-level
Window must be focused.
If the return value is false, the request is guaranteed to fail.
If the return value is true, the request will succeed unless it
is vetoed or something in the native windowing system intervenes,
preventing this Component's top-level ancestor from becoming
focused.
Returns: true if the request has a chance of success
Since: 1.4
See Also: requestFocus FocusEvent addFocusListener isFocusable isDisplayable clearGlobalFocusOwner
FOCUS_GAINED
event will be fired if and only if this
request is successful. To be successful, the component must be
displayable, showing, and focusable, and its ancestor top-level
Window must be focused.
If the return value is false, the request is guaranteed to fail.
If the return value is true, the request will succeed unless it
is vetoed or something in the native windowing system intervenes,
preventing this Component's top-level ancestor from becoming
focused. This method is meant to be called by derived
lightweight Components that want to avoid unnecessary repainting
when they know a given focus transfer need only be temporary.
Parameters: temporary true if the focus request is temporary
Returns: true if the request has a chance of success
Since: 1.4
See Also: requestFocus FocusEvent addFocusListener isFocusable isDisplayable clearGlobalFocusOwner
Deprecated: use {@link #setBounds(int, int, int, int)} instead
Sets the bounding rectangle for this component to the specified values. Note that these coordinates are relative to the parent, not to the screen.Parameters: x the X coordinate of the upper left corner of the rectangle y the Y coordinate of the upper left corner of the rectangle width the width of the rectangle height the height of the rectangle
Deprecated: use {@link #setSize(int, int)} instead
Sets the size of this component to the specified value.Parameters: width the new width of the component height the new height of the component
Deprecated: use {@link #setSize(Dimension)} instead
Sets the size of this component to the specified value.Parameters: d the new size of this component
Throws: NullPointerException if d is null
Parameters: c the new background color
See Also: getBackground
Parameters: x the X coordinate of the upper left corner of the rectangle y the Y coordinate of the upper left corner of the rectangle w the width of the rectangle h the height of the rectangle
Since: 1.1
See Also: getBounds Component setLocation Component setSize
Parameters: r the new bounding rectangle
Throws: NullPointerException if r is null
Since: 1.1
See Also: getBounds setLocation setSize
Parameters: o the new orientation (null
is accepted)
See Also: getComponentOrientation
Parameters: cursor the new cursor for this component
Parameters: dt the new drop target
See Also: isEnabled
Parameters: enabled true to enable this component
Since: 1.1
See Also: isEnabled
Parameters: focusable the new focusable status
Since: 1.4
Collections.EMPTY_SET
. The event dispatcher will
consume PRESSED, RELEASED, and TYPED events for the specified
key, although focus can only transfer on PRESSED or RELEASED.
The defaults are:
Identifier | Meaning | Default |
KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS | Normal forward traversal | TAB on KEY_PRESSED, Ctrl-TAB on KEY_PRESSED |
KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS | Normal backward traversal | Shift-TAB on KEY_PRESSED, Ctrl-Shift-TAB on KEY_PRESSED |
KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS | Go up a traversal cycle | None |
Parameters: id one of FORWARD_TRAVERSAL_KEYS, BACKWARD_TRAVERSAL_KEYS, or UP_CYCLE_TRAVERSAL_KEYS keystrokes a set of keys, or null
Throws: IllegalArgumentException if id or keystrokes is invalid
Since: 1.4
See Also: Component FORWARD_TRAVERSAL_KEYS BACKWARD_TRAVERSAL_KEYS UP_CYCLE_TRAVERSAL_KEYS
Parameters: focusTraversalKeysEnabled the new value of the flag
Since: 1.4
See Also: getFocusTraversalKeysEnabled Component Component
Parameters: f the new font for this component
See Also: getFont
Parameters: c the new foreground color
See Also: getForeground
Parameters: ignoreRepaint the new setting for ignoring repaint events
Since: 1.4
See Also: getIgnoreRepaint BufferStrategy setFullScreenWindow
Parameters: newLocale the new locale for this component
Parameters: x the new X coordinate of this component y the new Y coordinate of this component
See Also: getLocation Component
Parameters: p new coordinates for this component
Throws: NullPointerException if p is null
Since: 1.1
See Also: getLocation Component
Parameters: size the maximum size (null
permitted).
Since: 1.5
See Also: getMaximumSize
Parameters: size the minimum size (null
permitted).
Since: 1.5
See Also: getMinimumSize
Parameters: name the new name (null
permitted).
Since: 1.1
See Also: getName
Parameters: size the preferred size (null
permitted).
Since: 1.5
See Also: getPreferredSize
Parameters: width the new width of this component height the new height of this component
Parameters: d the new size of this component
Throws: NullPointerException if d is null
Since: 1.1
Parameters: visible true to make this component visible
Since: 1.1
Deprecated: use {@link #setVisible(boolean)} instead
Makes this component visible on the screen.Deprecated: use {@link #setVisible(boolean)} instead
Makes this component visible or invisible.Parameters: visible true to make this component visible
Deprecated: use {@link #getSize()} instead
Returns the size of this object.Returns: the size of this object
getClass().getName() + '[' + paramString() + ']'
.
Returns: a string representation of this component
Since: 1.1
See Also: requestFocus
Since: 1.4
See Also: requestFocus
Since: 1.4
See Also: requestFocus isFocusCycleRoot
super.update(g)
or paint(g)
.
Parameters: g the graphics context for this update
See Also: invalidate doLayout LayoutManager validate