Java Reference
In-Depth Information
Table 27-2
Commonly Used Method the Graphics Class (continued)
RETURNS
METHOD/ACTION
void
dispose()
Disposes of this graphics context and releases any
System resources that it is using.
Abstract
void drawArc(int x, int y, int width, int height,
int startAngle, int arcAngle)
Draws the outline of a circular or elliptical arc defined
bythe specified rectangle.
void drawBytes(byte[] data, int offset, int length, int x,
int y)
Draws the text given bythe specified byte arrayusing
the current color and font.
void drawChars(char[] data, int offset, int length, int x,
int y)
Draws the text in the specified character array, using
the current font and color.
abstract
void
drawLine(int x1, int y1, int x2, int y2)
Draws a line, using the current color, between point
(x1, y1) and point (x2, y2).
abstract
void
drawOval(int x, int y, int width, int height)
Draws the outline of an oval defined byits
bounding rectangle.
abstract
void
drawPolygon(int[] xPoints, int[] yPoints,
int nPoints)
Draws a closed polygon defined by arrays of x and y
coordinates.
void
drawPolygon(Polygon p)
Draws the outline of a polygon defined by the specified
polygon object.
abstract
void
drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
Draws a sequence of connected lines defined by
the corresponding arrays of x and y coordinates.
void
drawRect(int x, int y, int width, int height)
Draws the outline of the specified rectangle.
abstract
void
drawRoundRect(int x, int y, int width, int height,
int arcWidth, int arcHeight)
Draws an outlined round-cornered rectangle using the
graphics context's current color.
abstract
void
drawString(String str, int x, int y)
Draws the text given bythe specified string, using the
graphics context's current font and color.
(continues)
Search WWH ::




Custom Search