Method Summary |
double |
getAscent()
Returns the distance this string extends above the baseline. |
GRectangle |
getBounds()
Returns a GRectangle that specifies the bounding box for the string. |
double |
getDescent()
Returns the distance this string descends below the baseline. |
Font |
getFont()
Returns the font in which the GLabel is displayed. |
double |
getHeight()
Returns the height of this string, as it appears on the display. |
String |
getLabel()
Returns the string displayed by this object. |
double |
getWidth()
Returns the width of this string, as it appears on the display. |
void |
setFont(Font font)
Changes the font used to display the GLabel . |
void |
setFont(String str)
Changes the font used to display the GLabel as specified by
the string str , which is interpreted in the style of
Font.decode . |
void |
setLabel(String str)
Changes the string stored within the GLabel object, so that
a new text string appears on the display. |
Inherited Method Summary |
void | addMouseListener(MouseListener listener)
Adds a mouse listener to this graphical object.
|
void | addMouseMotionListener(MouseMotionListener listener)
Adds a mouse motion listener to this graphical object.
|
boolean | contains(GPoint pt)
Checks to see whether a point is inside the object.
|
boolean | contains(double x, double y)
Checks to see whether a point is "inside" the string, which is defined to be
inside the bounding rectangle.
|
Color | getColor()
Returns the color used to display the text of the GLabel .
|
GPoint | getLocation()
Returns the location of the GLabel as a GPoint object.
|
GDimension | getSize()
Returns the size of the bounding box for this object.
|
double | getX()
Returns the x-coordinate of the object.
|
double | getY()
Returns the y-coordinate of the object.
|
boolean | isVisible()
Checks to see whether the GLabel is visible.
|
void | move(double dx, double dy)
Moves the object on the screen using the displacements dx and dy .
|
void | movePolar(double r, double theta)
Moves the object using displacements given in polar coordinates.
|
void | removeMouseListener(MouseListener listener)
Removes a mouse listener from this graphical object.
|
void | removeMouseMotionListener(MouseMotionListener listener)
Removes a mouse motion listener from this graphical object.
|
void | sendBackward()
Moves this object one step toward the back in the z dimension.
|
void | sendForward()
Moves this object one step toward the front in the z dimension.
|
void | sendToBack()
Moves this object to the back of the display in the z dimension.
|
void | sendToFront()
Moves this object to the front of the display in the z dimension.
|
void | setColor(Color color)
Sets the color used to display the text of the GLabel .
|
void | setLocation(GPoint pt)
Sets the location of this object to the specified point.
|
void | setLocation(double x, double y)
Sets the location of the GLabel to the point (x , y ).
For a GLabel , the location is the point on the text baseline at which the
text starts.
|
void | setVisible(boolean visible)
Sets the visibility status of the GLabel .
|