Code: Select all
// Start the timer
t.start();
}
public void actionPerformed(ActionEvent e) {
if(e.getSource() == btnStart) {
// Move the car and then repaint the image
car.drive();
repaint();
}
}
//Methods
public void drive() {
if(xPos
Code: Select all
// Start the timer
t.start();
}
public void actionPerformed(ActionEvent e) {
if(e.getSource() == btnStart) {
// Move the car and then repaint the image
car.drive();
repaint();
}
}
//Methods
public void drive() {
if(xPos