{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

QuoteGUI - QuoteGUI.java Author Lewis/Loftus Solutions to...

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

View Full Document Right Arrow Icon
//******************************************************************** // QuoteGUI.java Author: Lewis/Loftus // // Solutions to Programming Project 6.21 //******************************************************************** / import javax.swing.*; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; i import java.awt.event.*; i public class QuoteGUI { private final int WIDTH = 550, HEIGHT = 80; private JPanel primary; private JLabel quote; private JRadioButton comedy, philosophy, carpentry, sciFi, einstein, work ; private final int COMEDY = 0, PHILOSOPHY = 1, CARPENTRY = 2, SCIFI = 3, EINSTEIN = 4, WORK = 5; private String[] quotes = { " Take my wife, please. ", " I think, therefore I am. ", " Measure twice. Cut once. ", " I'm sorry Dave, I'm afraid I can't do that. ", "Make everything as simple as possible, but not simpler.", "I find that the harder I work, the more luck I seem to have." }; //----------------------------------------------------------------- // Sets up a panel with a label and a set of radio buttons // that control its text. //----------------------------------------------------------------- public QuoteGUI() { quote = new JLabel (quotes[COMEDY]); quote.setFont (new Font ("Helvetica", Font.BOLD, 20)); comedy = new JRadioButton ("Comedy",true); comedy.setBackground (Color.green); philosophy = new JRadioButton ("Philosophy"); philosophy.setBackground (Color.green);
Background image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}