SpaceShipPanel - /* / SpaceShipPanel.java Author: Lewis and...

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

View Full Document Right Arrow Icon
//******************************************************************** // SpaceShipPanel.java Author: Lewis and Loftus // // Solution to Programming Project 7.15 //******************************************************************** / import javax.swing.*; import java.awt.*; import java.awt.event.*; i public class SpaceShipPanel extends JPanel { SpaceShip ship; //----------------------------------------------------------------- // Sets up the panel. Assumes there is never more than 100 // points clicked //----------------------------------------------------------------- public SpaceShipPanel () { setBackground (Color.black); ship = new SpaceShip(); MouseMoveListener monitor = new MouseMoveListener(); addMouseMotionListener (monitor); addMouseListener(monitor); } //----------------------------------------------------------------- // Draws the space ship //----------------------------------------------------------------- public void paintComponent (Graphics page) { super.paintComponent(page);
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

SpaceShipPanel - /* / SpaceShipPanel.java Author: Lewis and...

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