WK4 Programming Practice
WK3_Practice_Pizza/build.xml
Builds, tests, and runs the project WK3_Practice_Pizza.
WK3_Practice_Pizza/build/classes/.netbeans_automatic_build
WK3_Practice_Pizza/build/classes/.netbeans_update_resources
WK3_Practice_Pizza/build/classes/business/Person.class
package business; public synchronized class Person { private static final String DEFAULT_NAME = Not Given; String firstName; String lastName; public void Person(); public void Person(String, String); public String getFirstName(); public final void setFirstName(String); public String getLastName(); public final void setLastName(String); public String getFullName(); public String toString(); }
WK3_Practice_Pizza/build/classes/business/PizzaOrder$1.class
package business; synchronized class PizzaOrder$1 { static void <clinit>(); }
WK3_Practice_Pizza/build/classes/business/PizzaOrder$PizzaSize.class
package business; public final synchronized enum PizzaOrder$PizzaSize { public static final PizzaOrder$PizzaSize Small; public static final PizzaOrder$PizzaSize Medium; public static final PizzaOrder$PizzaSize Large; public static PizzaOrder$PizzaSize[] values(); public static PizzaOrder$PizzaSize valueOf(String); private void PizzaOrder$PizzaSize(String, int); static void <clinit>(); }
WK3_Practice_Pizza/build/classes/business/PizzaOrder.class
package business; public synchronized class PizzaOrder { private static final java.text.NumberFormat CF; public static final double DEFAULT_PRICE = 12.99; public static final double MIN_PRICE = 0.0; public static final double MAX_PRICE = 12.99; public static final String DEFAULT_TYPE = Item; private static final double SMALL_PRICE = 6.99; private static final double MEDIUM_PRICE = 9.99; private static final double LARGE_PRICE = 12.99; private static final double CHEESE_COST = 1.5; private static final double SAUSAGE_COST = 2.25; private static final double HAM_COST = 2.5; private final Person customer; private boolean cheeseSelected; private boolean sausageSelected; private boolean hamSelected; private PizzaOrder$PizzaSize pizzaSize; private double sizeCost; private double totalCost; public void PizzaOrder(); public String getTotalCost(); public void setPizzaSize(PizzaOrder$PizzaSize); public String getPizzaSize(); private void calculateTotalCost(); public void setFirstName(String); public void setLastName(String); public void setCheese(boolean); public void setSausage(boolean); public void setHam(boolean); public void clearOrder(); public String getOrderInformation(); public String toString(); static void <clinit>(); }
WK3_Practice_Pizza/build/classes/presentation/Pizza_Main$1.class
package presentation; synchronized class Pizza_Main$1 extends java.awt.event.FocusAdapter { void Pizza_Main$1(Pizza_Main); public void focusLost(java.awt.event.FocusEvent); }
WK3_Practice_Pizza/build/classes/presentation/Pizza_Main$10.class
package presentation; synchronized class Pizza_Main$10 implements java.awt.event.ActionListener { void Pizza_Main$10(Pizza_Main); public void actionPerformed(java.awt.event.ActionEvent); }
WK3_Practice_Pizza/build/classes/presentation/Pizza_Main$11.class
package presentation; synchronized class Pizza_Main$11 implements java.awt.event.ActionListener { void Pizza_Main$11(Pizza_Main); public void actionPerformed(java.awt.event.ActionEvent); }
WK3_Practice_Pizza/build/classes/presentation/Pizza_Main$12.class
package presentation; synchronized class Pizza_Main$12 implements java.awt.event.ActionListener { void Pizza_Main$12(Pizza_Main); public void actionPerformed(java.awt.event.ActionEvent); }
WK3_Practice_Pizza/build/classes/presentation/Pizza_Main$13.class
package presentation; synchronized class Pizza_Main$13 implements java.awt.event.ActionListener { void Pizza_Main$13(Pizza_Main); public void actionPerformed(java.awt.event.ActionEvent); }
WK3_Practice_Pizza/build/classes/presentation/Pizza_Main$14.class
package presentation; synchronized class Pizza_Main$14 implements java.awt.event.ActionListener { void Pizza_Main$14(Pizza_Main); public void actionPerformed(java.awt.event.ActionEvent); }
WK3_Practice_Pizza/build/classes/presentation/Pizza_Main$15.class
package presentation; synchronized class Pizza_Main$15 implements java.awt.event.ActionListener { void Pizza_Main$15(Pizza_Main); public void actionPerformed(java.awt.event.ActionEvent); }
WK3_Practice_Pizza/build/classes/presentation/Pizza_Main$16.class
package presentation; synchronized class Pizza_Main$16 implements java.awt.event.ActionListener { void Pizza_Main$16(Pizza_Main); public void actionPerformed(java.awt.event.ActionEvent); }
WK3_Practice_Pizza/build/classes/presentation/Pizza_Main$17.class
package presentation; final synchronized class Pizza_Main$17 implements Runnable { void Pizza_Main$17(); public void run(); }
WK3_Practice_Pizza/build/classes/presentation/Pizza_Main$2.class
package presentation; synchronized class Pizza_Main$2 extends java.awt.event.FocusAdapter { void Pizza_Main$2(Pizza_Main); public void focusLost(java.awt.event.FocusEvent); }
WK3_Practice_Pizza/build/classes/presentation/Pizza_Main$3.class
package presentation; synchronized class Pizza_Main$3 implements java.awt.event.ItemListener { void Pizza_Main$3(Pizza_Main); public void itemStateChanged(java.awt.event.ItemEvent); }
WK3_Practice_Pizza/build/classes/presentation/Pizza_Main$4.class
package presentation; synchronized class Pizza_Main$4 implements java.awt.event.ItemListener { void Pizza_Main$4(Pizza_Main); public void itemStateChanged(java.awt.event.ItemEvent); }
WK3_Practice_Pizza/build/classes/presentation/Pizza_Main$5.class
package presentation; synchronized class Pizza_Main$5 implements java.awt.event.ItemListener { void Pizza_Main$5(Pizza_Main); public void itemStateChanged(java.awt.event.ItemEvent); }
WK3_Practice_Pizza/build/classes/presentation/Pizza_Main$6.class
package presentation; synchronized class Pizza_Main$6 implements java.awt.event.ItemListener { void Pizza_Main$6(Pizza_Main); public void itemStateChanged(java.awt.event.ItemEvent); }
WK3_Practice_Pizza/build/classes/presentation/Pizza_Main$7.class
package presentation; synchronized class Pizza_Main$7 implements java.awt.event.ActionListener { void Pizza_Main$7(Pizza_Main); public void actionPerformed(java.awt.event.ActionEvent); }
WK3_Practice_Pizza/build/classes/presentation/Pizza_Main$8.class
package presentation; synchronized class Pizza_Main$8 implements java.awt.event.ItemListener { void Pizza_Main$8(Pizza_Main); public void itemStateChanged(java.awt.event.ItemEvent); }
WK3_Practice_Pizza/build/classes/presentation/Pizza_Main$9.class
package presentation; synchronized class Pizza_Main$9 implements java.awt.event.ActionListener { void Pizza_Main$9(Pizza_Main); public void actionPerformed(java.awt.event.ActionEvent); }
WK3_Practice_Pizza/build/classes/presentation/Pizza_Main.class
package presentation; public synchronized class Pizza_Main extends javax.swing.JFrame { private business.PizzaOrder aOrder; private javax.swing.JButton btnClearItems; private javax.swing.JButton btnExit; private javax.swing.JButton btnNew; private javax.swing.JButton btnSumbitOrder; private javax.swing.JCheckBox chkExtraCheese; private javax.swing.JCheckBox chkHam; private javax.swing.JCheckBox chkSausage; private javax.swing.ButtonGroup grpSize; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JLabel lblSubTotal; private javax.swing.JLabel lblTotal; private javax.swing.JLabel lblWelcome; private javax.swing.JMenuItem mnuClearItems; private javax.swing.JMenuItem mnuExit; private javax.swing.JMenu mnuFile; private javax.swing.JMenuItem mnuNew; private javax.swing.JMenu mnuOrder; private javax.swing.JMenuItem mnuSubmitOrder; private javax.swing.JPanel pnlOutput; private javax.swing.JPanel pnlPerson; private javax.swing.JPanel pnlSize; private javax.swing.JPanel pnlToppings; private javax.swing.JRadioButton radLarge; private javax.swing.JRadioButton radMedium; private javax.swing.JRadioButton radSmall; private javax.swing.JTextField txtFirstName; private javax.swing.JTextField txtLastName; private javax.swing.JTextArea txtOrderSummary; public void Pizza_Main(); private void newOrder(); private void setSubTotal(); private void clearItems(); private void submitOrder(); private void setSize(business.PizzaOrder$PizzaSize); private void setCheese(); private void setSausage(); private void setHam(); private void setLastName(); private void setFirstName(); private void terminateApplication(); private void initComponents(); private void mnuExitActionPerformed(java.awt.event.ActionEvent); private void radSmallItemStateChanged(java.awt.event.ItemEvent); private void radMediumItemStateChanged(java.awt.event.ItemEvent); private void radLargeItemStateChanged(java.awt.event.ItemEvent); private void btnSumbitOrderActionPerformed(java.awt.event.ActionEvent); private void chkExtraCheeseItemStateChanged(java.awt.event.ItemEvent); private void chkSausageActionPerformed(java.awt.event.ActionEvent); private void chkHamItemStateChanged(java.awt.event.ItemEvent); private void txtFirstNameFocusLost(java.awt.event.FocusEvent); private void txtLastNameFocusLost(java.awt.event.FocusEvent); private void btnExitActionPerformed(java.awt.event.ActionEvent); private void btnClearItemsActionPerformed(java.awt.event.ActionEvent); private void mnuClearItemsActionPerformed(java.awt.event.ActionEvent); private void mnuSubmitOrderActionPerformed(java.awt.event.ActionEvent); private void btnNewActionPerformed(java.awt.event.ActionEvent); private void mnuNewActionPerformed(java.awt.event.ActionEvent); public static void main(String[]); }
WK3_Practice_Pizza/build/classes/presentation/Pizza_Main.form
WK3_Practice_Pizza/manifest.mf
Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build
WK3_Practice_Pizza/nbproject/build-impl.xml
Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes No tests executed. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url
WK3_Practice_Pizza/nbproject/genfiles.properties
build.xml.data.CRC32=e78904b8 build.xml.script.CRC32=6012d748 [email protected] # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=e78904b8 nbproject/build-impl.xml.script.CRC32=a08c120c nbproject/[email protected]
WK3_Practice_Pizza/nbproject/private/config.properties
WK3_Practice_Pizza/nbproject/private/private.properties
compile.on.save=true do.depend=false do.jar=true javac.debug=true javadoc.preview=true user.properties.file=C:\\Users\\Tevis\\AppData\\Roaming\\NetBeans\\8.2\\build.properties
WK3_Practice_Pizza/nbproject/private/private.xml
WK3_Practice_Pizza/nbproject/project.properties
annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output application.title=WK3_Practice_Pizza application.vendor=Tevis build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath=\ ${run.classpath} debug.test.classpath=\ ${run.test.classpath} # Files in build.classes.dir which should be excluded from distribution jar dist.archive.excludes= # This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/WK3_Practice_Pizza.jar dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.external.vm=true javac.processorpath=\ ${javac.classpath} javac.source=1.8 javac.target=1.8 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=presentation.Pizza_Main manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys-prop.name=value: run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test
WK3_Practice_Pizza/nbproject/project.xml
org.netbeans.modules.java.j2seproject WK3_Practice_Pizza
WK3_Practice_Pizza/src/business/Person.java
WK3_Practice_Pizza/src/business/Person.java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package
business
;
public
class
Person
{
private
static
final
String
DEFAULT_NAME
=
"Not Given"
;
String
firstName
;
String
lastName
;
public
Person
()
{
this
.
firstName
=
DEFAULT_NAME
;
this
.
lastName
=
DEFAULT_NAME
;
}
public
Person
(
String
firstName
,
String
lastName
)
{
setFirstName
(
firstName
);
setLastName
(
lastName
);
}
public
String
getFirstName
()
{
return
firstName
;
}
public
final
void
setFirstName
(
String
firstName
)
{
this
.
firstName
=
firstName
;
}
public
String
getLastName
()
{
return
lastName
;
}
public
final
void
setLastName
(
String
lastName
)
{
this
.
lastName
=
lastName
;
}
public
String
getFullName
()
{
return
firstName
+
" "
+
lastName
;
}
@
Override
public
String
toString
()
{
return
getFullName
();
}
}
WK3_Practice_Pizza/src/business/PizzaOrder.java
WK3_Practice_Pizza/src/business/PizzaOrder.java
package
business
;
import
java
.
text
.
NumberFormat
;
import
java
.
util
.
Locale
;
public
class
PizzaOrder
{
private
static
final
NumberFormat
CF
=
NumberFormat
.
getCurrencyInstance
(
Locale
.
US
);
public
enum
PizzaSize
{
Small
,
Medium
,
Large
}
public
static
final
double
DEFAULT_PRICE
=
12.99
;
public
static
final
double
MIN_PRICE
=
0
;
public
static
final
double
MAX_PRICE
=
12.99
;
public
static
final
String
DEFAULT_TYPE
=
"Item"
;
private
static
final
double
SMALL_PRICE
=
6.99
;
private
static
final
double
MEDIUM_PRICE
=
9.99
;
private
static
final
double
LARGE_PRICE
=
12.99
;
private
static
final
double
CHEESE_COST
=
1.50
;
private
static
final
double
SAUSAGE_COST
=
2.25
;
private
static
final
double
HAM_COST
=
2.5
;
private
final
Person
customer
=
new
Person
();
private
boolean
cheeseSelected
=
false
;
private
boolean
sausageSelected
=
false
;
private
boolean
hamSelected
=
false
;
private
PizzaSize
pizzaSize
;
private
double
sizeCost
;
private
double
totalCost
=
0
;
public
PizzaOrder
()
{
clearOrder
();
}
public
String
getTotalCost
()
{
calculateTotalCost
();
return
CF
.
format
(
totalCost
);
}
public
void
setPizzaSize
(
PizzaSize
size
)
{
pizzaSize
=
size
;
}
public
String
getPizzaSize
()
{
String
str
;
switch
(
pizzaSize
)
{
case
Small
:
str
=
"Small"
;
break
;
case
Medium
:
str
=
"Medium"
;
break
;
case
Large
:
str
=
"Large"
;
break
;
default
:
str
=
"Large"
;
break
;
}
return
str
;
}
private
void
calculateTotalCost
()
{
totalCost
=
0
;
switch
(
pizzaSize
)
{
case
Small
:
sizeCost
=
SMALL_PRICE
;
break
;
case
Medium
:
sizeCost
=
MEDIUM_PRICE
;
break
;
case
Large
:
sizeCost
=
LARGE_PRICE
;
break
;
default
:
sizeCost
=
LARGE_PRICE
;
break
;
}
totalCost
=
sizeCost
;
if
(
cheeseSelected
)
{
totalCost
+=
CHEESE_COST
;
}
if
(
sausageSelected
)
{
totalCost
+=
SAUSAGE_COST
;
}
if
(
hamSelected
)
{
totalCost
+=
HAM_COST
;
}
}
public
void
setFirstName
(
String
firstName
){
customer
.
firstName
=
firstName
;
}
public
void
setLastName
(
String
lastName
)
{
customer
.
lastName
=
lastName
;
}
public
void
setCheese
(
boolean
selected
)
{
cheeseSelected
=
selected
;
}
public
void
setSausage
(
boolean
selected
)
{
sausageSelected
=
selected
;
}
public
void
setHam
(
boolean
selected
)
{
hamSelected
=
selected
;
}
public
void
clearOrder
()
{
setPizzaSize
(
PizzaSize
.
Large
);
setCheese
(
false
);
setHam
(
false
);
setSausage
(
false
);
}
public
String
getOrderInformation
()
{
StringBuilder
str
=
new
StringBuilder
();
str
.
append
(
"Pizza order for:\n"
);
str
.
append
(
customer
.
getFullName
());
if
(
cheeseSelected
)
{
str
.
append
(
"\nExtra cheese: "
);
str
.
append
(
CF
.
format
(
CHEESE_COST
));
}
if
(
sausageSelected
)
{
str
.
append
(
"\nSausage: "
);
str
.
append
(
CF
.
format
(
SAUSAGE_COST
));
}
if
(
hamSelected
)
{
str
.
append
(
"\nHam: "
);
str
.
append
(
CF
.
format
(
HAM_COST
));
}
str
.
append
(
"\nSize: "
);
str
.
append
(
getPizzaSize
());
str
.
append
(
": "
);
str
.
append
(
CF
.
format
(
sizeCost
));
str
.
append
(
"\nTotal: "
);
str
.
append
(
getTotalCost
());
return
str
.
toString
();
}
@
Override
public
String
toString
()
{
return
customer
.
toString
();
}
}
WK3_Practice_Pizza/src/presentation/Pizza_Main.form
WK3_Practice_Pizza/src/presentation/Pizza_Main.java
WK3_Practice_Pizza/src/presentation/Pizza_Main.java
package
presentation
;
import
business
.
PizzaOrder
;
import
javax
.
swing
.
JOptionPane
;
public
class
Pizza_Main
extends
javax
.
swing
.
JFrame
{
private
PizzaOrder
aOrder
=
null
;
public
Pizza_Main
()
{
initComponents
();
newOrder
();
}
private
void
newOrder
()
{
aOrder
=
new
PizzaOrder
();
clearItems
();
}
private
void
setSubTotal
()
{
lblSubTotal
.
setText
(
aOrder
.
getTotalCost
());
}
private
void
clearItems
()
{
txtFirstName
.
setText
(
""
);
txtLastName
.
setText
(
""
);
radLarge
.
setSelected
(
true
);
chkExtraCheese
.
setSelected
(
false
);
chkSausage
.
setSelected
(
false
);
chkHam
.
setSelected
(
false
);
txtOrderSummary
.
setText
(
""
);
lblSubTotal
.
setText
(
""
);
aOrder
.
clearOrder
();
}
private
void
submitOrder
()
{
StringBuilder
str
=
new
StringBuilder
();
str
.
append
(
"Order submitted\n"
);
str
.
append
(
aOrder
.
getOrderInformation
());
txtOrderSummary
.
setText
(
str
.
toString
());
}
private
void
setSize
(
PizzaOrder
.
PizzaSize
size
)
{
aOrder
.
setPizzaSize
(
size
);
setSubTotal
();
}
private
void
setCheese
()
{
if
(
chkExtraCheese
.
isSelected
())
{
aOrder
.
setCheese
(
true
);
}
else
{
aOrder
.
setCheese
(
false
);
}
setSubTotal
();
}
private
void
setSausage
()
{
if
(
chkSausage
.
isSelected
())
{
aOrder
.
setSausage
(
true
);
}
else
{
aOrder
.
setSausage
(
false
);
}
setSubTotal
();
}
private
void
setHam
()
{
if
(
chkHam
.
isSelected
())
{
aOrder
.
setHam
(
true
);
}
else
{
aOrder
.
setHam
(
false
);
}
setSubTotal
();
}
private
void
setLastName
()
{
if
(
aOrder
!=
null
)
{
aOrder
.
setLastName
(
txtLastName
.
getText
());
}
}
private
void
setFirstName
()
{
if
(
aOrder
!=
null
)
{
aOrder
.
setFirstName
(
txtFirstName
.
getText
());
}
}
private
void
terminateApplication
()
{
int
response
=
JOptionPane
.
NO_OPTION
;
String
prompt
=
"Do you want to quit the pizza program?"
;
String
title
=
"Quit Pizza Program"
;
response
=
JOptionPane
.
showConfirmDialog
(
null
,
prompt
,
title
,
JOptionPane
.
OK_CANCEL_OPTION
,
JOptionPane
.
QUESTION_MESSAGE
);
if
(
response
==
JOptionPane
.
YES_OPTION
)
{
System
.
exit
(
0
);
}
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@
SuppressWarnings
(
"unchecked"
)
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private
void
initComponents
()
{
grpSize
=
new
javax
.
swing
.
ButtonGroup
();
lblWelcome
=
new
javax
.
swing
.
JLabel
();
jLabel1
=
new
javax
.
swing
.
JLabel
();
pnlPerson
=
new
javax
.
swing
.
JPanel
();
jLabel2
=
new
javax
.
swing
.
JLabel
();
txtFirstName
=
new
javax
.
swing
.
JTextField
();
jLabel3
=
new
javax
.
swing
.
JLabel
();
txtLastName
=
new
javax
.
swing
.
JTextField
();
pnlSize
=
new
javax
.
swing
.
JPanel
();
radSmall
=
new
javax
.
swing
.
JRadioButton
();
radMedium
=
new
javax
.
swing
.
JRadioButton
();
radLarge
=
new
javax
.
swing
.
JRadioButton
();
pnlToppings
=
new
javax
.
swing
.
JPanel
();
chkExtraCheese
=
new
javax
.
swing
.
JCheckBox
();
chkSausage
=
new
javax
.
swing
.
JCheckBox
();
chkHam
=
new
javax
.
swing
.
JCheckBox
();
btnSumbitOrder
=
new
javax
.
swing
.
JButton
();
btnClearItems
=
new
javax
.
swing
.
JButton
();
pnlOutput
=
new
javax
.
swing
.
JPanel
();
jScrollPane1
=
new
javax
.
swing
.
JScrollPane
();
txtOrderSummary
=
new
javax
.
swing
.
JTextArea
();
btnExit
=
new
javax
.
swing
.
JButton
();
btnNew
=
new
javax
.
swing
.
JButton
();
lblTotal
=
new
javax
.
swing
.
JLabel
();
lblSubTotal
=
new
javax
.
swing
.
JLabel
();
jMenuBar1
=
new
javax
.
swing
.
JMenuBar
();
mnuFile
=
new
javax
.
swing
.
JMenu
();
mnuExit
=
new
javax
.
swing
.
JMenuItem
();
mnuOrder
=
new
javax
.
swing
.
JMenu
();
mnuSubmitOrder
=
new
javax
.
swing
.
JMenuItem
();
mnuClearItems
=
new
javax
.
swing
.
JMenuItem
();
mnuNew
=
new
javax
.
swing
.
JMenuItem
();
setDefaultCloseOperation
(
javax
.
swing
.
WindowConstants
.
EXIT_ON_CLOSE
);
setTitle
(
"Best Pizza Order"
);
lblWelcome
.
setFont
(
new
java
.
awt
.
Font
(
"Arial"
,
3
,
24
));
// NOI18N
lblWelcome
.
setForeground
(
new
java
.
awt
.
Color
(
0
,
0
,
255
));
lblWelcome
.
setText
(
"Welcome to Best Pizza!"
);
lblWelcome
.
setName
(
"lblWelcome"
);
// NOI18N
jLabel1
.
setFont
(
new
java
.
awt
.
Font
(
"Tahoma"
,
1
,
12
));
// NOI18N
jLabel1
.
setText
(
"Please enter your name and select your ordering options:"
);
pnlPerson
.
setBorder
(
javax
.
swing
.
BorderFactory
.
createTitledBorder
(
null
,
"Customer Information"
,
javax
.
swing
.
border
.
TitledBorder
.
DEFAULT_JUSTIFICATION
,
javax
.
swing
.
border
.
TitledBorder
.
DEFAULT_POSITION
,
new
java
.
awt
.
Font
(
"Tahoma"
,
1
,
11
),
new
java
.
awt
.
Color
(
51
,
51
,
255
)));
// NOI18N
jLabel2
.
setText
(
"First Name:"
);
txtFirstName
.
setToolTipText
(
"Enter your first name"
);
txtFirstName
.
addFocusListener
(
new
java
.
awt
.
event
.
FocusAdapter
()
{
public
void
focusLost
(
java
.
awt
.
event
.
FocusEvent
evt
)
{
txtFirstNameFocusLost
(
evt
);
}
});
jLabel3
.
setText
(
"Last Name:"
);
txtLastName
.
setToolTipText
(
"Enter your last name"
);
txtLastName
.
addFocusListener
(
new
java
.
awt
.
event
.
FocusAdapter
()
{
public
void
focusLost
(
java
.
awt
.
event
.
FocusEvent
evt
)
{
txtLastNameFocusLost
(
evt
);
}
});
javax
.
swing
.
GroupLayout
pnlPersonLayout
=
new
javax
.
swing
.
GroupLayout
(
pnlPerson
);
pnlPerson
.
setLayout
(
pnlPersonLayout
);
pnlPersonLayout
.
setHorizontalGroup
(
pnlPersonLayout
.
createParallelGroup
(
javax
.
swing
.
GroupLayout
.
Alignment
.
LEADING
)
.
addGroup
(
pnlPersonLayout
.
createSequentialGroup
()
.
addContainerGap
()
.
addGroup
(
pnlPersonLayout
.
createParallelGroup
(
javax
.
swing
.
GroupLayout
.
Alignment
.
LEADING
)
.
addComponent
(
jLabel2
)
.
addComponent
(
jLabel3
))
.
addPreferredGap
(
javax
.
swing
.
LayoutStyle
.
ComponentPlacement
.
UNRELATED
)
.
addGroup
(
pnlPersonLayout
.
createParallelGroup
(
javax
.
swing
.
GroupLayout
.
Alignment
.
LEADING
,
false
)
.
addComponent
(
txtFirstName
)
.
addComponent
(
txtLastName
,
javax
.
swing
.
GroupLayout
.
DEFAULT_SIZE
,
399
,
Short
.
MAX_VALUE
))
.
addContainerGap
(
javax
.
swing
.
GroupLayout
.
DEFAULT_SIZE
,
Short
.
MAX_VALUE
))
);
pnlPersonLayout
.
setVerticalGroup
(
pnlPersonLayout
.
createParallelGroup
(
javax
.
swing
.
GroupLayout
.
Alignment
.
LEADING
)
.
addGroup
(
pnlPersonLayout
.
createSequentialGroup
()
.
addContainerGap
(
javax
.
swing
.
GroupLayout
.
DEFAULT_SIZE
,
Short
.
MAX_VALUE
)
.
addGroup
(
pnlPersonLayout
.
createParallelGroup
(
javax
.
swing
.
GroupLayout
.
Alignment
.
BASELINE
)
.
addComponent
(
jLabel2
)
.
addComponent
(
txtFirstName
,
javax
.
swing
.
GroupLayout
.
PREFERRED_SIZE
,
javax
.
swing
.
GroupLayout
.
DEFAULT_SIZE
,
javax
.
swing
.
GroupLayout
.
PREFERRED_SIZE
))
.
addPreferredGap
(
javax
.
swing
.
LayoutStyle
.
ComponentPlacement
.
RELATED
)
.
addGroup
(
pnlPersonLayout
.
createParallelGroup
(
javax
.
swing
.
GroupLayout
.
Alignment
.
BASELINE
)
.
addComponent
(
jLabel3
)
.
addComponent
(
txtLastName
,
javax
.
swing
.
GroupLayout
.
PREFERRED_SIZE
,
javax
.
swing
.
GroupLayout
.
DEFAULT_SIZE
,
javax
.
swing
.
GroupLayout
.
PREFERRED_SIZE
)))
);
pnlSize
.
setBorder
(
javax
.
swing
.
BorderFactory
.
createTitledBorder
(
null
,
"Pizza Size (please select one)"
,
javax
.
swing
.
border
.
TitledBorder
.
DEFAULT_JUSTIFICATION
,
javax
.
swing
.
border
.
TitledBorder
.
DEFAULT_POSITION
,
new
java
.
awt
.
Font
(
"Tahoma"
,
1
,
11
),
new
java
.
awt
.
Color
(
51
,
51
,
255
)));
// NOI18N
grpSize
.
add
(
radSmall
);
radSmall
.
setText
(
"Small: $6.99 "
);
radSmall
.
setToolTipText
(
"Select for small pizza at $6.99"
);
radSmall
.
addItemListener
(
new
java
.
awt
.
event
.
ItemListener
()
{
public
void
itemStateChanged
(
java
.
awt
.
event
.
ItemEvent
evt
)
{
radSmallItemStateChanged
(
evt
);
}
});
grpSize
.
add
(
radMedium
);
radMedium
.
setText
(
"Medium: $9.99 "
);
radMedium
.
setToolTipText
(
"Select for medium pizza at $9.99"
);
radMedium
.
addItemListener
(
new
java
.
awt
.
event
.
ItemListener
()
{
public
void
itemStateChanged
(
java
.
awt
.
event
.
ItemEvent
evt
)
{
radMediumItemStateChanged
(
evt
);
}
});
grpSize
.
add
(
radLarge
);
radLarge
.
setText
(
" Large: $12.99"
);
radLarge
.
setToolTipText
(
"Select for large pizza at $12.99"
);
radLarge
.
addItemListener
(
new
java
.
awt
.
event
.
ItemListener
()
{
public
void
itemStateChanged
(
java
.
awt
.
event
.
ItemEvent
evt
)
{
radLargeItemStateChanged
(
evt
);
}
});
javax
.
swing
.
GroupLayout
pnlSizeLayout
=
new
javax
.
swing
.
GroupLayout
(
pnlSize
);
pnlSize
.
setLayout
(
pnlSizeLayout
);
pnlSizeLayout
.
setHorizontalGroup
(
pnlSizeLayout
.
createParallelGroup
(
javax
.
swing
.
GroupLayout
.
Alignment
.
LEADING
)