IncDecGUI - IncDecGUI.java Author Lewis/Loftus Solution to...

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

View Full Document Right Arrow Icon
//******************************************************************** // IncDecGUI.java Author: Lewis/Loftus // // Solution to Programming Project 5.13 //******************************************************************** / import java.awt.Graphics; import java.awt.Dimension; import java.awt.event.*; import javax.swing.*; i public class IncDecGUI { private int WIDTH = 100; private int HEIGHT = 90; private int INITIAL_NUMBER = 50; private JFrame frame; private JPanel panel; private JLabel numberLabel; private JButton incButton, decButton; private int number; //----------------------------------------------------------------- // Sets up the GUI. //----------------------------------------------------------------- public IncDecGUI() { frame = new JFrame ("Random Numbers"); frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); number = INITIAL_NUMBER; numberLabel = new JLabel (String.valueOf(number)); incButton = new JButton("Increment"); incButton.addActionListener (new IncListener()); decButton = new JButton("Decrement");
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

IncDecGUI - IncDecGUI.java Author Lewis/Loftus Solution to...

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