DrawPolylinePanel -...

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: //******************************************************************** // DrawPolylinePanel.java Author: Lewis and Loftus // // Solution to Programming Project 7.11 //******************************************************************** / import javax.swing.*; import java.awt.*; import java.awt.event.*; i public class DrawPolylinePanel extends JPanel { int xPoints, yPoints; int numPoints; //----------------------------------------------------------------- // Sets up the panel. Assumes there is never more than 100 // points clicked //----------------------------------------------------------------- public DrawPolylinePanel () { setBackground (Color.black); xPoints = new int [100]; yPoints = new int [100]; numPoints = 0; addMouseListener (new MouseClickListener()); Button clearButton = new Button("Clear"); clearButton.addActionListener(new ButtonListener()); add(clearButton); } //----------------------------------------------------------------- // Draws the polyline //-----------------------------------------------------------------...
View Full Document

Page1 / 2

DrawPolylinePanel -...

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