Write a JavaFX class that conforms to the MVC pattern and uses an FXML file to implement the view. All data entered by the user and used by the program must be stored in the model. No data can be stored in the controller. The user interface should look as follows:
The user should be able to enter a String in the first TextField, an int in the second TextField, and a double in the third TextField. Just like class names, all of the Strings entered should start with capital letters in order to be valid. When a user presses enter in any of the three TextFields, the program should store the information in the TextFields if and only if all of the information contained in the TextFields is valid.
When the user clicks the button and there is no int value in the int TextField, then the program should display all sets of the string, integer, and double values entered by the user in the TextArea, one per line. If there is an int value in the TextField when the user presses the button, then the program should display only the string, integer, double values corresponding to the user’s Enter keypress that matches the int in the TextField, assuming there is one that matches. If there is no matching Enter keypress, then display NOT VALID in the textarea.
Here is an example:
- The user enters “Alpha”, 1, and 1.1 in the three TextFields and presses Enter.
- The user enters “Bravo”, 2, and 2.2 in the three TextFields and presses Enter.
- The user enters “Charlie”, 3, and 3.3 in the three TextFields and presses Enter.
- The user clears the int TextField and presses the button. The TextArea will display:
- Alpha 1 1.1
- Bravo 2 2.2
- Charlie 3 3.3
- The user puts a 2 in the int TextField and presses the button. The TextArea will display:
- Bravo 2 2.2
- The user puts a 6 in the int TextField and presses the button. The TextArea will display:
- NOT VALID