ReboundPanel

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 // // Represents the primary panel for the Rebound program. //******************************************************************** / 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 DELAY = 50, IMAGE_SIZE = 35; private ImageIcon image, newImage; private Timer timer; private int x, y, moveX, moveY; private int x2, y2, moveX2, moveY2; //----------------------------------------------------------------- // Sets up the panel, including the timer for the animation. //----------------------------------------------------------------- public ReboundPanel() { timer = new Timer(DELAY, new ReboundListener()); image = new ImageIcon ("happyFace.gif"); newImage = new ImageIcon ("happyFace.gif"); x = 0; y = 40; moveX = moveY = 3; x2 = 0; y2 = 40; moveX2 = 5; moveY2 = 8;
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.

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