java.lang.Objectjava.awt.Component
public abstract class Component
Constructor Summary | |
---|---|
protected |
Component()
Constructs a new component. |
Method Summary | |
---|---|
boolean |
contains(int x,
int y)
Checks whether this component "contains" the specified point, where x and y are defined to be
relative to the coordinate system of this component. |
Color |
getBackground()
Gets the background color of this component. |
Rectangle |
getBounds()
Gets the bounds of this component in the form of a Rectangle object. |
Component |
getComponentAt(int x,
int y)
Determines if this component or one of its immediate subcomponents contains the (x, y) location, and if so, returns the containing component. |
Font |
getFont()
Gets the font of this component. |
Color |
getForeground()
Gets the foreground color of this component. |
int |
getHeight()
Returns the current height of this component. |
Dimension |
getSize()
Returns the size of this component in the form of a Dimension object. |
int |
getWidth()
Returns the current width of this component. |
int |
getX()
Returns the current x coordinate of the components origin. |
int |
getY()
Returns the current y coordinate of the components origin. |
boolean |
isEnabled()
Determines whether this component is enabled. |
boolean |
isForegroundSet()
Returns whether the foreground color has been explicitly set for this Component. |
boolean |
isShowing()
Determines whether this component is showing on screen. |
boolean |
isValid()
Determines whether this component is valid. |
void |
repaint()
Repaints this component. |
void |
setBackground(Color c)
Sets the background color of this component. |
void |
setBounds(int x,
int y,
int width,
int height)
Moves and resizes this component. |
void |
setEnabled(boolean b)
Enables or disables this component, depending on the value of the parameter b . |
void |
setFont(Font f)
Sets the font of this component. |
void |
setForeground(Color c)
Sets the foreground color of this component. |
void |
setName(String name)
Sets the name of the component to the specified string. |
void |
setSize(int width,
int height)
Resizes this component so that it has width width
and height height . |
void |
setVisible(boolean b)
Shows or hides this component depending on the value of parameter b . |