Draw Ellipses : Graphics « 2D Graphics « Java Tutorial






import java.applet.Applet;
import java.awt.Graphics;

public class MainClass extends Applet {
  public void paint(Graphics g) {
    g.drawOval(10, 10, 50, 50);
    g.fillOval(100, 10, 75, 50);
    g.drawOval(190, 10, 90, 30);
    g.fillOval(70, 90, 140, 100);
  }
}








16.2.Graphics
16.2.1.Draw rectangles
16.2.2.Fill a solid three-dimensional rectangle
16.2.3.Draw Ellipses
16.2.4.Draw 2D shapeDraw 2D shape
16.2.5.Draw Arcs
16.2.6.Draw PolygonDraw Polygon
16.2.7.Resizing output to fit the current size of a window.
16.2.8.Demonstrate XOR mode.Demonstrate XOR mode.