View RSS Feed

Java AWT

Java Abstract Window Toolkit (AWT)

  1. Drawing an Ellipse

    by , 03-06-2012 at 08:52 PM
    Ellipse2D class presents the ellipse which is defined by bounded rectangles. An ellipse in float & precision are specified by these subclasses.

    • Ellipse2D.Double
    • Ellipse2D.Float

    Following attributes define ellipse:

    • Location
    • Height
    • Width

    Java Code:
    Creation of an ellipse is explained by this example.
    // draw Ellipse2D.Double
    g2.draw(new Ellipse2D.Double(x, y,