import java.awt.*; import java.applet.*; public class auto extends Applet { public void paint(Graphics g) { int x[]=new int[4],y[]=new int[4]; //Deklarationen für Punktkoordinaten g.setColor(Color.green); //Farbe Gruen g.fillRect(0,160,320,120); //grünes Rechteck g.setColor(Color.red); //Farbe Rot g.fillRect(80,120,100,30); //unteres rotes Rechteck x[0]=80;y[0]=120;x[1]=90;y[1]=100; //Punktkoordinaten x[2]=175;y[2]=100; x[3]=180;y[3]=120; g.drawPolygon(x,y,4); //obere rote Fensterfläche g.drawLine(101,99,101,119); //rote Trennlinie im oberen Rechteck g.setColor(new Color(80,80,100)); //Farbe Anthrazit g.fillOval(90,140,20,20); //Vorderrad g.fillOval(140,140,20,20); //Hinterrad } }