SHARE
TWEET

Untitled

a guest Jun 19th, 2017 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.awt.Graphics;
  2. import java.awt.Graphics2D;
  3. import javax.swing.JComponent;
  4.  
  5. public class CarComponent extends JComponent
  6. {
  7.     public void paintComponent(Graphics g)
  8.     {
  9.         Graphics2D g2 = (Graphics2D) g;
  10.        
  11.         Car car1 = new Car(0,0);
  12.        
  13.         int x = getWidth() - 60;
  14.         int y = getHeight() - 30;
  15.        
  16.         Car car2 = new Car(x,y);
  17.        
  18.         car1.draw(g2);
  19.         car2.draw(g2);
  20.     }
  21. }
RAW Paste Data
Want to get better at Java?
Learn to code Java in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top