LineCrossPanel - LineCrossPanel.java Author Lewis and Loftus Alicia Nicoll Solution to Programming Project 8.17 import javax.swing import java.awt

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

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: //******************************************************************** // LineCrossPanel.java Author: Lewis and Loftus / Alicia Nicoll // // Solution to Programming Project 8.17 //******************************************************************** / import javax.swing.*; import java.awt.*; import java.awt.event.*; i public class LineCrossPanel extends JPanel { private final int DELAY = 20; private final int SHIFT = 1; private final int LENGTH = 40; private Timer timer; private int x, y, crossPoint; //----------------------------------------------------------------- // Sets up the panel. //----------------------------------------------------------------- public LineCrossPanel (Timer timer) { timer.addActionListener(new LineCrossActionListener()); //timer.start(); x = 0; y = 100; crossPoint = (int) (Math.random() * 100) + 50; setBackground (Color.black); } //----------------------------------------------------------------- // Draws the line in the current location....
View Full 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

LineCrossPanel - LineCrossPanel.java Author Lewis and Loftus Alicia Nicoll Solution to Programming Project 8.17 import javax.swing import java.awt

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