View RSS Feed

Java AWT

Drawing an Arc

Rate this Entry
by , 03-06-2012 at 08:54 PM (964 Views)
A piece of ellipse is drawn by Arc2D. Following present an arc class.
  • A bounding rectangle
  • An angular extent
  • A start angle
  • A closure type

An ellipse in float & double precision are specified.
  • Arc2D.Double
  • Arc2D.Float

Arc2D class defines 3 types of arcs:
  • OPEN
  • PIE

The parameters and size of the arc are set by applying these different methods:
  • By supplied Dimension2D and Point2D.
  • Directly by coordinates.
  • By copying Arc2D that is already existing.

An arc creation is explained by this code given below.
Java Code:
// draw Arc2D.Double
g2.draw(new Arc2D.Double(x, y,
                         90, 135,

Submit "Drawing an Arc" to Facebook Submit "Drawing an Arc" to Digg Submit "Drawing an Arc" to Submit "Drawing an Arc" to StumbleUpon Submit "Drawing an Arc" to Google