Java Reference
In-Depth Information
Display 18.12
Some Methods in the Class
Graphics
(part 2 of 3)
public void
draw3DRect(
int
x,
int
y,
int
width,
int
height, boolean raised)
Draws the outline of the specified rectangle. (
x, y
) is the location of the upper-left corner. The
rectangle is highlighted to look like it has thickness. If
raised
is
true
, the highlight makes the
rectangle appear to stand out from the background. If
raised
is
false
, the highlight makes
the rectangle appear to be sunken into the background.
public void
fill3DRect(
int
x,
int
y,
int
width,
int
height, boolean raised)
Fills the rectangle specified by
draw3DRec(x, y, width, height, raised)
public abstract void
drawRoundRect (
int
x,
int
y,
int
width,
int
height,
int
arcWidth,
int
arcHeight)
Draws the outline of the specified round-cornered rectangle. (x, y) is the location of the upper-left
corner of the enclosing regular rectangle.
arcWidth
and
arcHeight
specify the shape of the
round corners. See the text for details.
public abstract void
fillRoundRect(
int
x,
int
y,
int
width,
int
height,
int
arcWidth,
int
arcHeight)
Fills the rounded rectangle specified by
drawRoundRec(x, y, width, height, arcWidth, arcHeight)
public abstract void
drawOval(
int
x,
int
y,
int
width,
int
height)
Draws the outline of the oval with the smallest enclosing rectangle that has the specified width
and height. The (imagined) rectangle has its upper-left corner located at (
x, y
).
public abstract void
fillOval
(
int
x,
int
y,
int
width
,
int
height
)
Fills the oval specified by
drawOval(x, y, width, height)
public abstract void
drawArc(
int
x,
int
y,
int
width
,
int
height
,
int
startAngle,
int
arcSweep)
Draws part of an oval that just fits into an invisible rectangle described by the first four arguments.
The portion of the oval drawn is given by the last two arguments. See the text for details.