QuoteGUI - QuoteGUI.java Author Lewis\/Loftus Solutions to Programming Project 6.21 import import import i import javax.swing java.awt.Color

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

This preview shows page 1 - 2 out of 3 pages.

//******************************************************************** // 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);

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture