From: <whe...@us...> - 2003-07-24 17:05:37
|
Update of /cvsroot/ordweb/uop/pos407/wayneh/week4 In directory sc8-pr-cvs1:/tmp/cvs-serv15113 Modified Files: JPizzaria.java Log Message: added several toppings. Index: JPizzaria.java =================================================================== RCS file: /cvsroot/ordweb/uop/pos407/wayneh/week4/JPizzaria.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JPizzaria.java 24 Jul 2003 16:44:28 -0000 1.1 --- JPizzaria.java 24 Jul 2003 17:05:32 -0000 1.2 *************** *** 2,6 **** import java.awt.*; import java.awt.event.*; ! public class JPizzaria extends JFrame implements ItemListener { --- 2,10 ---- import java.awt.*; import java.awt.event.*; ! /* ! @author Wayne Hernandez ! @description Create an application that allows a customer to choose a pizza size ! and options, the options add $1 each except for cheese. ! */ public class JPizzaria extends JFrame implements ItemListener { *************** *** 10,13 **** --- 14,19 ---- JCheckBox pepperBox = new JCheckBox("Pepperoni"); JCheckBox greenBox = new JCheckBox("Green peppers"); + JCheckBox onionBox = new JCheckBox("Onions"); + JCheckBox mushBox = new JCheckBox("Mushrooms"); JLabel sizeList = new JLabel("Size LIst"); JLabel aEvent = new JLabel("Event Handlers Incorporated"); *************** *** 32,39 **** --- 38,49 ---- pepperBox.addItemListener(this); greenBox.addItemListener(this); + onionBox.addItemListener(this); + mushBox.addItemListener(this); pane.add(sizeBox); pane.add(cheeseBox); pane.add(pepperBox); pane.add(greenBox); + pane.add(onionBox); + pane.add(mushBox); pane.add(aEvent); pane.add(totPrice); *************** *** 59,63 **** // add $1 if option selected ! if ((source == pepperBox) || (source == greenBox)) { int select = e.getStateChange(); --- 69,73 ---- // add $1 if option selected ! if ((source == pepperBox) || (source == greenBox) || (source == onionBox) || (source == mushBox)) { int select = e.getStateChange(); |