Answered step by step
Verified Expert Solution
Question
1 Approved Answer
QUESTION 3 (50 MARKS) STH is a software company located at Ayer Keroh Melaka. The company is based on Java application and framework. The company
QUESTION 3 (50 MARKS) STH is a software company located at Ayer Keroh Melaka. The company is based on Java application and framework. The company has to develop a java application for a sandwich shop. The shop sells three types of sandwich named tuna, egg mayo, and ham. The shop daily sells maximum of 500 pieces for each of the sandwich type. Delivery service is provided upon customer's request. Figure 2 illustrates the order form for the sandwich shop. Based on the sandwich shop application as shown in Figure 2, answer the following questions: Sandwich Shope Sandwich Order Form titlePanel, North region Tuna: orderPanel, Center region Egg Mayo: I Ham: Delivery: deliveryPanel, Center region 10 Yes No Submit Reset buttoPanel, South region Figure 2: Sandwich order form a) List and describe FIVE (5) graphical user interface (GUI) components suitable for the sandwich order form. b b) In the development, the programmer who compiled the java codes, received an error message as shown in Figure 3. Based on your experience, what is the cause of the error and how to solve it? (5 marks) SandwichForm.java:24: error: cannot find symbol private ButtonGroup radioButtonGroup = new ButtonGroup(); Figure 3: Error of compilation Write the Java codes to produce the window frame as shown in Figure 2. The properties of the window frame are shown in Table 2. Table 2: Properties of window frame Properties Value/action Frame title Sandwich shop Size Width = 200, height = 300 Visibility yes Operation when user close the frame Exit the application (5 marks) d) Write the Java codes to produce radio buttons for delivery option as shown in Figure 2 The radio buttons should be attached to a panel called deliverypanel. The codes should also include the declaration of the radio buttons and the panel. (5 marks) e) How do you ensure that only one delivery option that has been created in Question 3(d) is selected at a time? (2 marks) f) What is the name of the listener interface and the event that must be implemented in g) Figure 4 presents the code snippet to generate the GUI components at order Panel and button Panel orderPanel = new JPanel(); orderPanel.setLayout(new GridLayout(4,2,1,1)); for(int i=0; i
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started