CountDown - 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
// ********************************************************** // CountDown.java // // Draws a digital display that counts down from 10. The // display can be stopped or reset with a mouse click. // ********************************************************** import java.awt.*; import java.awt.event.*; import javax.swing.*; public class CountDown extends JApplet { private final int DELAY = 200; private Timer timer; // --------------------------------------------------------- // Initialize the applet, including 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 CountDownPanel(timer, this)); } // ---------------------------------------------------------// Start the animation when the applet is started. // ---------------------------------------------------------public void start() { timer.start(); } // ---------------------------------------------------------// Stop the animation when the applet is stopped. // ---------------------------------------------------------public void stop() { timer.stop(); } }...
View Full Document

Ask a homework question - tutors are online