Question

In: Computer Science

******You do not need to get everything working exactly as it says, I mostly just need...

******You do not need to get everything working exactly as it says, I mostly just need an outline of how to create this GUI and add up the costs and print them all out. Any help at all will be greatly appreciated*******

Design and implement a Java program that creates a GUI that will allow a customer to order pizza and other items from a Pizza Paarlor.  The customer should be able to order a variety of items which are listed below. The GUI should allow the customer (via JavaFX UI Controls - text areas, buttons, checkbox, radio button, etc.) to input the following information:

  • Customer Contact Info (Use text fields to input these from user)
    • First Name
    • Last Name
    • Phone Number
    • Address
  • Type of food that can be ordered are: (Use dropdown menu to pick)
    • pizza
      • Small
      • Large
    • calzone
    • garlic knots
  • Quantity of each food item being ordered (Use text field that only accepts numbers to type in a number between 1 and 50 )
    • Pizza toppings (Use dropdown to pick)
      • Plain
      • Extra cheese
      • Mushrooms
      • Pepperoni

    Pricing (assign these prices to each item)

    Base Price for items :

  • Small Plain Pie –  $11.25
  • Large Plain Pie –  $14.00
  • Calzone - $7.75
  • Garlic Knots -$3.50
  • Additional fees for Toppings:

  • Small Pie - $2.00 per topping
  • Large Pie - $3.00 per topping

Conditions:

  • The GUI will have two buttons. The first will be used to create a running total of the current order. This button should be clicked every time an item is added to the order to give a current total of the order.
  • The second button will be used to print the following:
    • Customer Contact Info
    • All items and the quantity ordered
    • The grand total for the order

Solutions

Expert Solution

// UI CODE
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;

public class MyPanel extends JPanel {
    private JLabel Pizza Parlor;
    private JLabel FirstName;
    private JTextField jcomp3;
    private JLabel LastName;
    private JTextField jcomp5;
    private JLabel Phone;
    private JTextField jcomp7;
    private JLabel jcomp8;
    private JTextField jcomp9;
    private JLabel jcomp10;
    private JLabel jcomp11;
    private JTextField jcomp12;
    private JComboBox Types;
    private JLabel Pizza Toppings;
    private JComboBox jcomp15;
    private JButton Total Sum;
    private JButton jcomp17;

    public MyPanel() {
        //construct preComponents
        String[] TypesItems = {"Small", "Large", "calzone", "garlic knots"};
        String[] jcomp15Items = {"Plain", "Extra cheese", "Mushrooms", "Pepperoni"};

        //construct components
        Pizza Parlor = new JLabel ("Pizza Parlor");
        FirstName = new JLabel ("First Name");
        jcomp3 = new JTextField (5);
        LastName = new JLabel ("Last Name");
        jcomp5 = new JTextField (5);
        Phone = new JLabel ("Phone No.");
        jcomp7 = new JTextField (5);
        jcomp8 = new JLabel ("Address");
        jcomp9 = new JTextField (5);
        jcomp10 = new JLabel ("Type of Pizza");
        jcomp11 = new JLabel ("Quantity");
        jcomp12 = new JTextField (5);
        Types = new JComboBox (TypesItems);
        Pizza Toppings = new JLabel ("Pizza Toppings");
        jcomp15 = new JComboBox (jcomp15Items);
        Total Sum = new JButton ("Total Sum");
        jcomp17 = new JButton ("Submit Info");

        //set components properties
        Pizza Parlor.setToolTipText ("Pizza Parlor");
        Types.setToolTipText ("Types of Pizza");

        //adjust size and set layout
        setPreferredSize (new Dimension (667, 393));
        setLayout (null);

        //add components
        add (Pizza Parlor);
        add (FirstName);
        add (jcomp3);
        add (LastName);
        add (jcomp5);
        add (Phone);
        add (jcomp7);
        add (jcomp8);
        add (jcomp9);
        add (jcomp10);
        add (jcomp11);
        add (jcomp12);
        add (Types);
        add (Pizza Toppings);
        add (jcomp15);
        add (Total Sum);
        add (jcomp17);

        //set component bounds (only needed by Absolute Positioning)
        Pizza Parlor.setBounds (265, 10, 70, 25);
        FirstName.setBounds (5, 70, 100, 25);
        jcomp3.setBounds (80, 75, 100, 20);
        LastName.setBounds (5, 120, 100, 25);
        jcomp5.setBounds (80, 120, 100, 20);
        Phone.setBounds (5, 160, 100, 25);
        jcomp7.setBounds (80, 160, 100, 20);
        jcomp8.setBounds (5, 200, 70, 25);
        jcomp9.setBounds (80, 205, 105, 60);
        jcomp10.setBounds (290, 70, 100, 25);
        jcomp11.setBounds (295, 110, 100, 25);
        jcomp12.setBounds (410, 115, 100, 25);
        Types.setBounds (410, 75, 100, 25);
        Pizza Toppings.setBounds (295, 155, 100, 25);
        jcomp15.setBounds (410, 155, 100, 25);
        Total Sum.setBounds (360, 220, 100, 25);
        jcomp17.setBounds (45, 315, 100, 25);
    }


    public static void main (String[] args) {
        JFrame frame = new JFrame ("MyPanel");
        frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add (new MyPanel());
        frame.pack();
        frame.setVisible (true);
    }
}

Related Solutions

******You do not need to get everything working exactly as it says, I mostly just need...
******You do not need to get everything working exactly as it says, I mostly just need an outline of how to create this GUI and add up the costs and print them all out. Any help at all will be greatly appreciated******* ********MUST BE IN JAVAFX********** Design and implement a Java program that creates a GUI that will allow a customer to order pizza and other items from a Pizza Paarlor.  The customer should be able to order a variety of...
I have the answers for everything, I just need for it to be explained as to...
I have the answers for everything, I just need for it to be explained as to why that's the answer. A 24-year old female automotive technician presents herself at the doctor’s office. She complains of fever and of pain in her left hand. On physical examination, the patient had a deep wound on her left palm that was oozing pus. She had purplish, red streaks running up her left arm. She had enlarged lymph nodes at the elbow and under...
What exactly does Sartre mean when he says that"if Goddoes not exist, then everything is...
What exactly does Sartre mean when he says that"if God does not exist, then everything is permitted"? Do you agree with him? Why or why not?
What exactly does Sartre mean when he says that "If God does not exist, then everything...
What exactly does Sartre mean when he says that "If God does not exist, then everything is permitted"? Do you agree with him? Why or why not?
Hey yall, Im working on a quiz I completed. I really need to get a 100...
Hey yall, Im working on a quiz I completed. I really need to get a 100 I worked all the problems out and i was wondering if one of yall would mind checking it for me. If i missed one if yall could tell me how to get the correct answer? 1.The intermolecular forces present in CH3NH2 include which of the following? I. dipole-dipole II. ion-dipole III. dispersion IV. hydrogen bonding ANS: I, III, and IV 2. A liquid boils...
please do not change the category. you just typing no drawing needed i need Just speed...
please do not change the category. you just typing no drawing needed i need Just speed and few sentences! its easy for you. problem 1) Describe the pros and cons between BJT the Voltage divider Bias, Emitter Bias, Collector Feedback Bias. 2) Compare the Voutput and current characteristics between BJT Early Effect, Fet Channel. And cause of that two.
Why do you think a third financial statement is important? Do we not get everything we...
Why do you think a third financial statement is important? Do we not get everything we need from the Balance Sheet and Income Statement? What information does the Cash Flow Statement give us that is unique, and why do investors need that information?
For my economy class I need to annswer these questions but I just dont get/cant find...
For my economy class I need to annswer these questions but I just dont get/cant find the right inf. The Presentville – Futureville case: 1. Explain what motivated each group to make the decisions they made.
I am currently working on this problem. It says it is wrong, and I was wondering...
I am currently working on this problem. It says it is wrong, and I was wondering if someone could correct my code to where its ouput is as followed. Expected Output: 6↵ 5↵ 4↵ 3↵ 2↵ 1 Actual Output: 9↵ 8↵ 7↵ 6↵ 5↵ 4↵ 3↵ 2↵ 1↵ 0↵ 9.10: Reverse Array Write a function that accepts an int array and the array’s size as arguments. The function should create a copy of the array, except that the element values...
I need to do a research paper on self-esteem and job performance. I just need some...
I need to do a research paper on self-esteem and job performance. I just need some ideas to get me started
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT