Rebound - public void init() { timer = new Timer (DELAY,...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************************** // Rebound.java Author: Lewis/Loftus // // Demonstrates an animation and the use of the Timer class. //******************************************************************** / import java.awt.*; import java.awt.event.*; import javax.swing.*; i public class Rebound extends JApplet { private final int DELAY = 20; private Timer timer; //----------------------------------------------------------------- // Sets up the applet, including the timer for the animation. //-----------------------------------------------------------------
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: public void init() { timer = new Timer (DELAY, null); getContentPane().add (new ReboundPanel(timer)); } //-----------------------------------------------------------------// Starts the animation when the applet is started. //-----------------------------------------------------------------public void start () { timer.start(); } //-----------------------------------------------------------------// Stops the animation when the applet is stopped. //-----------------------------------------------------------------public void stop () { timer.stop(); } }...
View Full Document

This note was uploaded on 05/17/2011 for the course COP 3530 taught by Professor Davis during the Spring '08 term at University of Florida.

Ask a homework question - tutors are online