ReboundPanel - /* / ReboundPanel.java Author: Lewis/Loftus...

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

View Full Document Right Arrow Icon
//******************************************************************** // ReboundPanel.java Author: Lewis/Loftus // // Solution to Programming Project 8.14 //******************************************************************** / import java.awt.*; import java.awt.event.*; import javax.swing.*; i public class ReboundPanel extends JPanel { private final int WIDTH = 300, HEIGHT = 100; private final int IMAGE_SIZE = 35; private ImageIcon image; private Timer timer; private int x, y, moveX, moveY; //----------------------------------------------------------------- // Sets up the panel, including the timer for the animation. //----------------------------------------------------------------- public ReboundPanel (Timer countdown) { timer = countdown; timer.addActionListener (new ReboundListener()); image = new ImageIcon ("happyFace.gif"); x = 0; y = 40; moveX = moveY = 3; addMouseListener(new MouseClickListener()); setBackground (Color.black); 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 05/17/2011 for the course COP 3530 taught by Professor Davis during the Spring '08 term at University of Florida.

Page1 / 2

ReboundPanel - /* / ReboundPanel.java Author: Lewis/Loftus...

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