Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For this assignment, you are to write a JavaFX program that does the following: Creates a GUI with a label and associated text field. The
For this assignment, you are to write a JavaFX program that does the following:
Creates a GUI with a label and associated text field.
The label field should contain the text Number:
In the text field, a user will enter a number. Your program should display an error message in the text field described in if the user does not input a valid number which is an integer that is greater than or equal to zero
The GUI should also have a text field to output. After the Process Input button see below is selected, the program will determine if the number input in the text field in is prime or not. If it is prime, this text field should be updated to state the input number and the text is prime or is not prime as appropriate. For example, for the number it would produce: is prime and for the number it would produce is not prime
Important: Dont worry about doing sophisticated methods to determine if a number is prime or to generate the prime factors. A brute force method is ok Note the definition of a prime number: A Prime number is prime if it is only evenly divisible by or itself. Also note that is not a prime number.
You GUI needs to include Process Input and Cancel buttons, and the text on these buttons must be as indicated here Process Input, Cancel When Process Input is pressed, the program should read the text in do the prime number determination, and update the output text field with the appropriate text. When cancel is pressed, your program should gracefully terminate.
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