/** * The driver for this animation. * * @param args * none. This driver shouldn't take any arguments. */ public static void main(String[] args) { JFrame mainFrame = new JFrame("Bouncing Ball"); int maxSize = 500; JPanel animation = new AnimationPanel(); animation.setPreferredSize(new Dimension(maxSize, maxSize)); // add the JPanel to the pane mainFrame.getContentPane().add(animation, BorderLayout.CENTER); // clean up mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); mainFrame.pack(); mainFrame.setResizable(false); mainFrame.setVisible(true); }