CountDownPanel

CountDownPanel - / * / CountDownPanel.java / / Panel for a...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// ********************************************************** // CountDownPanel.java // // Panel for 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 CountDownPanel extends JPanel { private final int WIDTH = 600; private final int HEIGHT = 400; private final int DISPLAY_WIDTH = 150; private final int DISPLAY_HEIGHT = 100; private final int DELAY = 200; private final int COUNT_START = 10; private DigitalDisplay clock; private Timer timer; // --------------------------------------------------------- // Set up the applet. // --------------------------------------------------------- public CountDownPanel (Timer countdown, JApplet applet) { // Set up the timer timer = countdown; timer.addActionListener(new CountListener()); applet.addMouseListener (new ClickListener()); setBackground (Color.blue); setPreferredSize (new Dimension (WIDTH, HEIGHT));
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/22/2010 for the course CS 202 taught by Professor Fong during the Spring '10 term at SIU Carbondale.

Page1 / 2

CountDownPanel - / * / CountDownPanel.java / / Panel for a...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online