Question
CIST 2371 Introduction to Java Unit 07 Lab, JavaFX Due Date: See Syllabus For this lab you will write two programs: Unit07_Prog01 and Unit07_Prog02. It
CIST 2371 Introduction to Java Unit 07 Lab, JavaFX Due Date: See Syllabus For this lab you will write two programs: Unit07_Prog01 and Unit07_Prog02. It is highly recommended you use the JGrasp IDE for this assignment [1]. First Program: Unit07_Prog01 Write a program whose source file is named Unit07_Prog01.java that creates a Stage with the title "Hello JavaFX!". Within the Stage a create a Scene that is 300 x 250 in size. And within that Scene create a single Button. The Button will have the title "Say 'Hello JavaFX'" as shown in the figure below (ignore the window decorations, they are platform specific, in this case Windows 10). You may want to use a Pane, such as a StackPane for example, to get the Button to center correctly (How would you do that?). Once you have the GUI displaying properly, add the code to enable the Button to handle the ActionEvent that occurs when the button is clicked. Code your ActionEvent Handler so that the String "Hello JavaFX" is printed out on standard out (System.out). Clicking the x button on the top will stop the program (you get that behavior for free). Second Program: Unit07_Prog02 Write a program whose source file is named Unit07_Prog02.java that creates a Stage with the title "Three Button Demo". Within the Stage a create a Scene that is 310 x 60 in size. Within that Scene you will put an HBox. In that HBox you place three buttons. The button labels will read: Button 01, Button 02, Button 03. The buttons should have a preferred size of 100x20. Version 3.0 Page 1 of 2 The user interface should look like this (ignore the window decorations, they are platform specific, in this case Ubuntu 16.04): Once you have the GUI displaying properly, create an ActionEvent handler for each button that will print out on standard out (System.out) the following text: Button n pressed!, where n is the number of the button (01, 02, or 03). The user should be able to press buttons and see the printout on standard out to her hearts content. Clicking the x button on the top will stop the program. What To Turn In You will create your files, Unit07_Prog01.java and Unit07_Prog02.java in a folder named Unit07. Zip up the Unit07 folder into a zip file called Unit07_.zip. For example, Irina Krush's zip file would look like this: Unit07_ikrush.zip Be sure to test this zip file and its contents before turning it in. PLEASE NOTE THAT INCORRECTLY NAMED FILES OR FOLDERS WILL RESULT IN A ZERO (0) FOR THE ASSIGNMENT. ALSO NOTE, I WILL ACCEPT ONLY ONE (1) ZIP FILED HANDED IN. IF YOU NEED TO RESUBMIT YOU MAY DO SO, BUT BE AWARE I WILL DELETE ALL OLDER SUBMISSIONS FOR A Unit WITHOUT LOOKING AT THEM, ASSUMING THE LATEST ENTRY CONTAINS EVERYTHING YOU INTENDED TO HAND IN. The Comment Block EVERY source code file you turn in for this course must have the comment block handed out in the first class meeting (customized for the situation). Rubric (50 points) Program 01 has comment block: 5 pts GUI has a panel and Button with correct text on the button: 5 pts GUI has the correct title on the window: 5 pts When the Button is clicked the correct text prints out on standard out: 10 pts Program 02 has comment block: 5 pts GUI has a panel and Buttons with correct text on each button: 5 pts GUI has the correct title on the window: 5 pts When each Button is clicked the correct text prints out on standard out: 10 pts [1] http://www.jgrasp.org/ Version 3.0 Page 2 of 2
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