DirectionPanel - /* / DirectionPanel.java Author:...

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

View Full Document Right Arrow Icon
//******************************************************************** // DirectionPanel.java Author: Lewis/Loftus // // Solution to Programming Project 8.13 //******************************************************************** / import javax.swing.*; import java.awt.*; import java.awt.event.*; i public class DirectionPanel extends JPanel { private final int JUMP = 10; // increment for image movement private final int IMAGE_SIZE = 31; private final int BEGIN_POS = 200; private ImageIcon up, down, right, left, currentImage; private int x, y; //----------------------------------------------------------------- // Sets up this panel and loads the images. //----------------------------------------------------------------- public DirectionPanel (JApplet applet) { applet.addKeyListener (new DirectionListener()); x = BEGIN_POS; y = BEGIN_POS; up = new ImageIcon ("arrowUp.gif"); down = new ImageIcon ("arrowDown.gif"); left = new ImageIcon ("arrowLeft.gif"); right = new ImageIcon ("arrowRight.gif");
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

DirectionPanel - /* / DirectionPanel.java Author:...

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