MovePanel - / / / / / / / / * FILE: MovePanel.java The...

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

View Full Document Right Arrow Icon
// ******************************************************************* // FILE: MovePanel.java // // The display panel for a key events program -- arrow keys are used // to move a stick figure around, the g key is used to make the figure // grow by 50% (increase in height by 50%), the s key causes the // figure to shrink (to half its size) // ******************************************************************* import javax.swing.*; import java.awt.*; import java.awt.event.*; public class MovePanel extends JPanel { private final int WIDTH = 600; private final int HEIGHT = 400; private final int JUMP = 5; // number of pixels moved each step // the following give the initial parameters for the figure private final int START_CENTER = WIDTH/2; private final int START_BOTTOM = HEIGHT - 40; private final int SIZE = HEIGHT / 2; private StickFigure stickMan; // ---------------------------------------------------- // Constructor: Sets up the panel. // ----------------------------------------------------
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 / 3

MovePanel - / / / / / / / / * FILE: MovePanel.java The...

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