import java.awt.*;
import java.applet.*;
public class House extends Applet {
public void init() {
}
void DrawTree (Graphics g) {
g.setColor(Color.yellow);
g.fillRect(308+x,240,15,30);
g.setColor(Color.green);
int x2[] = {290+x,317+x,340+x};
int y2[] = {260,240,260};
g.fillPolygon(x2,y2,3);
int x3[] = {295+x,317+x,335+x};
int y3[] = {250,230,250};
g.fillPolygon(x3,y3,3);
int x4[] = {300+x,317+x,330+x};
int y4[] = {240,220,240};
g.fillPolygon(x4,y4,3);
}
public void paint(Graphics g) {
DrawTree(g);
}
} |