import java.applet.Applet;
import java.awt.*;
public class Graph2_Triangle extends Applet
{
int x1[]={20,120,220,20};
int y1[]={20,120,20,20};
int n1=4;
int x2[]={120,220,220,120};
int y2[]={120,20,220,120};
int n2=4;
public void paint(Graphics g)
{
setBackground(Color.green);
g.drawPolygon(x1,y1,n1);
g.fillPolygon(x2,y2,n2);
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.