The following program uses some of the methods of Graphics class.
import java.applet.*;
import java.awt.*;
public class Test extends Applet
{
public void paint(Graphics g)
{
g.setColor(Color.red);
g.drawLine(10,10,200,100);
g.drawRect(20,20,100,20);
g.fillRect(120,120,100,100);
g.drawOval(10,150,50,50);
g.fillOval(110,250,50,80);
g.drawRoundRect(5,5,350,350,20,20);
g.drawArc(200,200,150,150,40,40);
}
}
0 comments:
Post a Comment