Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import java.applet.Applet;
- public class car extends Applet {
- public void paint(Graphics g) {
- String mpg = new String("0.25 Miles Per Gallon!!");
- String exaust = new String("Dual Exaust!");
- String wheel = new String("Uni-Wheel!");
- Color puce = new Color(204,136,153);
- //super efficient tower
- g.setColor(Color.green);
- g.fillRect(300,100,200,300);
- //car body
- g.setColor(Color.cyan);
- g.fillRect(200,400,400,100);
- //uni-wheel point out
- g.setColor(Color.magenta);
- g.drawLine(430,480,360,540);
- g.drawString(wheel,350,550);
- //uni-wheel
- g.setColor(Color.black);
- g.fillOval(400,470,50,50);
- //windows
- g.fillRect(320,120,160,100);
- g.fillRect(320,260,160,100);
- //exaust
- g.fillRect(180,480,20,10);
- g.fillRect(180,440,20,10);
- //mpg
- g.drawString(mpg,280,60);
- //head lights
- g.setColor(puce);
- g.fillRect(600,400,10,20);
- g.drawLine(600,410,650,370);
- g.drawLine(600,410,650,410);
- g.drawLine(600,410,650,450);
- //dual exaust point out
- g.setColor(Color.magenta);
- g.drawRect(170,420,40,80);
- g.drawLine(170,420,140,390);
- g.drawString(exaust,110,390);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement