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

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

View Full Document Right Arrow Icon
//******************************************************************** // OdometerPanel.java Author: Lewis and Loftus / Alicia Nicoll // // Solution to Programming Project 7.13 //******************************************************************** / import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.text.DecimalFormat; i public class OdometerPanel extends JPanel { private final int APPLET_WIDTH = 300; private final int APPLET_HEIGHT = 300; private double totalDistance; private Point current = null, previous = null; private DecimalFormat fmt; //----------------------------------------------------------------- // Initializes the panel //----------------------------------------------------------------- public OdometerPanel () { OdometerListener listener = new OdometerListener(); addMouseListener (listener); addMouseMotionListener (listener); totalDistance = 0.0; fmt = new DecimalFormat ("0.#"); setBackground (Color.black); } //------------------------------------------------------------------
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

OdometerPanel - /* / OdometerPanel.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