Help Me with Java GUI?
For a project in my horrible java course I have to make a GUI that is a pizza ordering program. If someone could help me with any of these things it would be great :Change the background. (To another type of background etc.) Change the top bar where the title is. (Not the title the bar.)Make separate tabs for toppings, size, how to order and submit/cancel.import java.awt.*;import javax.swing.*;import java.awt.event.*;import java.util.*;public class pizzaProject extends JFrame implements ActionListener, ItemListener{ private JLabel lname, lsize, ltoppings, ldilivery; private JRadioButton rsizeS, rsizeM, rsizeL, rsizeXL, rDelivery, rPickup; private JCheckBox cBacon, cBBQ_Chicken, cBeef, cCajun_Chicken, cChicken_Masala, cChicken_Tikka, cChorizo, cDuck, cHam, cHoney_Cured_Ham, cMeatballs, cPepperoni, cProscuitto, cSalami, cSausage, cSerrano_Ham, cTurkey, cVenison; private JButton bOK, bCancel; private JTextField tName; private boolean cSelected = false; private boolean rSelected = false; private boolean rSelectedS = false; private String sDelivery; private String sSize; private String sPickup; private String toppings; private int i=0; public pizzaProject() { JFrame myFrame = new JFrame("Meaty Pizza Palace order form:"); tName = new JTextField("", 25); lname = new JLabel("Enter your first and last name:"); lsize = new JLabel("Select the size:"); ltoppings = new JLabel("Select the topping(s):"); ldilivery = new JLabel("Select how you want to get your pizza:"); cBacon = new JCheckBox("Bacon", false); cBBQ_Chicken = new JCheckBox("BBQ Chicken", false); cBeef = new JCheckBox("Beef", false); cCajun_Chicken = new JCheckBox("Cajun Chicken", false); cChicken_Masala = new JCheckBox("Chicken Masala", false); cChicken_Tikka = new JCheckBox("Chicken Tikka", false); cChorizo = new JCheckBox("Chorizo", false); cDuck = new JCheckBox("Duck", false); cHam = new JCheckBox("Ham", false); cHoney_Cured_Ham = new JCheckBox("Honey Cured Ham", false); cMeatballs = new JCheckBox("Meatballs", false); cPepperoni = new JCheckBox("Pepperoni", false); cProscuitto = new JCheckBox("Proscuitto", false); cSalami = new JCheckBox("Salami", false); cSausage= new JCheckBox("Sausage", false); cSerrano_Ham = new JCheckBox("Serrano Ham", false); cTurkey = new JCheckBox("Turkey", false); cVenison = new JCheckBox("Venison", false); cBacon.addItemListener(this); cBBQ_Chicken.addItemListener(this); cBeef.addItemListener(this); cCajun_Chicken.addItemListener(this); cChicken_Masala.addItemListener(this); cChicken_Tikka.addItemListener(this); cChorizo.addItemListener(this); cDuck.addItemListener(this); cHam.addItemListener(this); cHoney_Cured_Ham.addItemListener(this); cMeatballs.addItemListener(this); cPepperoni.addItemListener(this); cProscuitto.addItemListener(this); cSalami.addItemListener(this); cSausage.addItemListener(this); cSerrano_Ham.addItemListener(this); cTurkey.addItemListener(this); cVenison.addItemListener(this); bOK = new JButton("Submit Order"); bCancel = new JButton("Clear Order"); bOK.addActionListener(this); bCancel.addActionListener(this); rsizeS = new JRadioButton("Small", false); rsizeM = new JRadioButton("Medium", false); rsizeL = new JRadioButton("Large", false); rsizeXL = new JRadioButton("Extra Large", false); rsizeS.addItemListener(this); rsizeM.addItemListener(this); rsizeL.addItemListener(this); rsizeXL.addItemListener(this); rDelivery = new JRadioButton("Delivery", false); rPickup = new JRadioButton("Pickup", false); rDelivery.addItemListener(this); rPickup.addItemListener(this); ButtonGroup myBG1 = new ButtonGroup(); myBG1.add(rDelivery); myBG1.add(rPickup); ButtonGroup myBG2 = new ButtonGroup(); myBG2.add(rsizeS); myBG2.add(rsizeM); myBG2.add(rsizeL); myBG2.add(rsizeXL); myFrame.getContentPane().setLayout(new FlowLayout()); myFrame.getContentPane().add(lname); myFrame.getContentPane().add(tName); myFrame.getContentPane().add(ldilivery); myFrame.getContentPane().add(rDelivery); myFrame.getContentPane().add(rPickup); sSize = ""; myFrame.getContentPane().add(lsize); myFrame.getContentPane().add(rsizeS); myFrame.getContentPane().add(rsizeM); myFrame.getContentPane().add(rsizeL); myFrame.getContentPane().add(rsizeXL); toppings = "no toppi
|