Lab 12.2 (Year 3 Sem 1)

Lab 12.2 is the fourteenth lab in semester 1 of year 3, and the fourteenth lab in the total of year 3. It is a lab for intro to JavaFX, and is considered to be of medium difficulty.

Description
No description was provided for this lab.

Unlocked after completion

 * OCD (Score at least 60% for Lab 12.2: Intro to JavaFX)
 * FX Newbie (Score at least 80% for Lab 12.2: Intro to JavaFX)

Files

 * SeatingPlan.java
 * names.txt
 * Q1SampleOutput.mp4

Side note
Rest of files are available [[Media:Y3S1L12.2.zip|here]].

Note that it might say the files are malicious. They are not, as the zip file contains only the pre-provided files from Coursemology.

Question
Create a the JavaFX program below using pure code as outline in section 12.5. Your FX program should look as follow on load: The GUI consist of 2 labels (one for question, one for error message), 1 textfield and 2 buttons (check answer and next question) contained in a FlowPane. Download Q1SampleOutput video to see how the program should work. Some settings info:  Set frame size to 400 by 50.  Set the range of the integer values to be [-20, 20].  Use a try-catch to check for invalid input.  To change the color of a control as follows (for example, to change the text color of a label named label1 to red): Note that you need to import the following:   You may create a TextField as follows: TextField tf = new TextField;    You should demo your end product to your teacher BEFORE you finalize submission.</b> Zip your ENTIRE project folder and submit that zip file:</b>

Question
One of the main advantage of coding the UI using pure Java code is you will be able to quickly create many similar UI using loops. For example, the program below shows how 20 Labels can be generated using a for loop on load. In this question, you will create a simple JavaFX program that will generate a random seating plan. You may wish to refer to page 11 of your Chapter 12 notes for some starter code. Your program will work as follows:  On load, the program will read in the names listed in names.txt and show a seating plan in the original order of the names listed in the text file.</li> If the user clicks the Randomize button, the names will be shuffled, generating a new seating plan.</li> Note that your program should work even if the number of names in names.txt changes. You may assume there will not be more than 50 names in the text file, and we would have a fixed number of columns (i.e. 5 in this case).</li> </ul> Use the draft file provided as a base for the program. Some hints are provided in the draft file. You should demo your end product to your teacher BEFORE you finalize submission.</b> Zip your ENTIRE project folder and submit that zip file:</b>