/* Gigobite.java A simple order form using Java's built-in graphics classes. 0 First, save this in your folder as Gigobite.java with your changes. Compile and run; test all of the buttons, check boxes, etc. Answer each of the following questions by adding comments immediately before each line or block of lines to which the comment refers. 1 Look up documentation for JList and JComboBox. What's the difference? Convert at least one of the JList items to a JComboBox. 2 a) What do the 2 and 10 do in the JTextArea comments definition? b) What is the effect of the 5 lines marked below with "// Q2b" ? 3 Try removing "this." in the two lines: this.setBackground(Color.yellow); this.setSize(450,300); then recompile and run. What is the effect and why? 4 a) Alter the order in which items are added to the sandwichName array. You could do the same for the other JLists. Compile, run, and note (in comment lines at appropriate places) what the effect is. b) Change the order in which the widgets themselves are added to the application. Compile, run, and note. 5 a) Add widgets to Gigobite to describe a few different "Combo-Meals," i.e., combinations composed of a sandwich, side order, and a drink. Describe the combo-meals in a JList and adda a label to identify the list, then add a few different combinations to that list. Test. b) Add "Special JCheckBox" with appropriate label. 6 Change the colors of the various compoenents and the application itself to something less disgusting than the initial color scheme. 7 a) Experiment with the application's setSize parameters 450 and 300 to determine what, exactly, they do. (Same line refered to in Q3 above). b) Add a line in the main() that sets the size of the JFrame, which dominates? EC Add code to Gigobite's paint method that draws a simple logo using some of the Graphics methods such as drawLine(), drawArc() */ import java.awt.*; import javax.swing.*; public class Gigobite extends JPanel { JCheckBox superSize = new JCheckBox("Super Size?"); JTextField reminder = new JTextField("Ask for Coupons!",18); // Q4a String sandwichNames[] = {"Hamburg", "Cheeseburg", "1/4-pound", "1/2-pound","Side O' Beef"}; JList sandwiches = new JList(sandwichNames); String sideNames[] = {"Fries", "Chips", "Gummy Bears"}; JList sides = new JList(sideNames); String drinkNames[] = {"Cola", "Root Bear", "Coffee", "Milk", "Water"}; JComboBox drinks = new JComboBox(drinkNames); // Q2a JTextArea comments = new JTextArea("Hold the pickles!", 2, 10); JButton order = new JButton("Place Order"); JLabel label1 = new JLabel("Sandwiches"); JLabel label2 = new JLabel("Drinks"); JLabel label3 = new JLabel("Side Orders"); JLabel title = new JLabel("Gigo-BITES"); Font myFont1 = new Font("Helvetica",Font.BOLD,36); Font myFont2 = new Font("Helvetica",Font.ITALIC,12); public Gigobite() { // Q3&Q7 // Set the application's background color and size. this.setBackground(Color.yellow); this.setSize(300,600); // Adjust the properties of individual widgets. // Q2b label1.setFont(myFont2); label2.setBackground(Color.blue); label3.setForeground(Color.white); title.setFont(myFont1); title.setForeground(Color.blue); // Q4b // Add all of the widgets to our application add(label1); add(sandwiches); add(label2); add(drinks); add(label3); add(sides); add(comments); add(superSize); add(reminder); add(order); add(title); } public static void main(String args[]) { Gigobite gb = new Gigobite(); JFrame jf = new JFrame(); jf.add(gb); // Q7b jf.??? jf.setVisible(true); } }