DigitalDisplay

DigitalDisplay - / * / DigitalDisplay.java / / A simple...

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

View Full Document Right Arrow Icon
// *************************************************** // DigitalDisplay.java // // A simple rectangular display of a single number // *************************************************** import java.awt.*; public class DigitalDisplay { private int displayVal; // value to be displayed private int x, y; // position private int width, height; // size private Font displayFont; // font for the number // --------------------------------------------------------- // construct a DigitalDisplay object with the given values // and New Century Schoolbook font in 40 point bold // --------------------------------------------------------- public DigitalDisplay(int start, int x, int y, int w, int h) { this.x = x; this.y = y; width = w; height = h; displayVal = start; displayFont = new Font ("New Century Schoolbook", Font.BOLD, 40); } // ---------------------------- // decrement the display value // ---------------------------- public void decrement() { displayVal--; } // ---------------------------- // increment the display value
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

DigitalDisplay - / * / DigitalDisplay.java / / A simple...

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