Question: Complete the Java code below with necessary statements to create the following GUI exactly as shown in the figure (three screenshots for the same application)

Complete the Java code below with necessary statements to create the following GUI exactly as shown in the figure (three screenshots for the same application) : X X X Win a prize Win a prize 1 Fils Win a prize 1000 KD Note that the first component is a button with the text "Win a prize". Whereas the second component is a text field which is initially empty. When the user clicks on the button, one of the following messages should be randomly displayed inside the text field: "10000 KD", "1000 KD", "100 KD", "10 KD", "1 KD", "1 Fils". Kindly make sure that the button event must always work without changes, even if we increase or decrease the number of possible messages. public class GUIControls extends Application { Il declare all GUI components in the below block public static void main(String[] args) { launch(args); } public void start(Stage stage) { Il your code goes here } Complete the Java code below with necessary statements to create the following GUI exactly as shown in the figure (three screenshots for the same application) : X X X Win a prize Win a prize 1 Fils Win a prize 1000 KD Note that the first component is a button with the text "Win a prize". Whereas the second component is a text field which is initially empty. When the user clicks on the button, one of the following messages should be randomly displayed inside the text field: "10000 KD", "1000 KD", "100 KD", "10 KD", "1 KD", "1 Fils". Kindly make sure that the button event must always work without changes, even if we increase or decrease the number of possible messages. public class GUIControls extends Application { Il declare all GUI components in the below block public static void main(String[] args) { launch(args); } public void start(Stage stage) { Il your code goes here }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
