public class CarMover
1: import java.awt.*;
2: import java.awt.geom.*;
3: import java.awt.event.*;
4: import javax.swing.*;
6: /**
7: A program that allows users to move a car with the mouse.
8: */
9: public class CarMover
10: {
11: public static void main(String[] args)
12: {
13: JFrame frame = new JFrame();
14: frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
16: frame.add(new CarComponent());
17: frame.setSize(FRAME_WIDTH, FRAME_HEIGHT);
18: frame.setVisible(true);
19: }
21: private static final int FRAME_WIDTH = 400;
22: private static final int FRAME_HEIGHT = 400;
23: }