posted 17 years ago
Tried to make minimal changes to answer your question, including:
Changed all class names to avoid name-clashing so you can run as-is.
Eliminated the updateXPosition and startTimer methods.
Made the Timer a member variable (class scope) and implemented ActionListener for
Main2 for the timer to use. Animation code is inside the actionPerformed method.
Changed DrawingPanel to a JPanel and eliminated its update method.