109 Program to draw Circle in Java

Code:

import java.applet.*;
import java.awt.*;

public class Circle extends Applet
{
public void paint( Graphics g )
{
g.setColor(Color.red);
g.drawOval(150,150,100,100);

g.setColor(Color.green);
g.fillOval(150,150,100,100);
}
}

/*
<applet code="Circle" height=400 width=400>
</applet>
*/



Ouput:

draw Circle in Java

Previous
Next Post »