Как бы я сделал так, чтобы автомобиль непрерывно перекраился после нажатия кнопки «Пуск», и кнопку «Пуск» не нужно нажимать несколько раз для перемещения автомобиля. // 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
Подробнее здесь: https://stackoverflow.com/questions/795 ... e-start-bu