Question
Generate the digits 0 through 9 (1 digit per task) 100 times each and you will have them displayed in your TextArea, rather than in
Generate the digits 0 through 9 (1 digit per task) 100 timeseach and you will have them displayed in your TextArea, rather than in the console. A single button will trigger the threads all at once.
2) Use a cached Thread pool to run these 10 tasks.
3) A single press of the button should trigger all 10 tasks. You will be creating an event handler that contains Thread pool code and the execution of your 10 tasks.
4) Set the text wrap feature to "true" for your TextArea so that it prints in a block instead of one long row.
5) Use some kind of code, such as Thread.sleep() so thatwhen the digits get added to the TextArea, they are fairly randomized-looking and not just a bunch of 1s and 2s and then a bunch of 3s and 4s.
6) I would like to see the digits added in real time. As the tasks are processed, we should see one or a few digits at a time added to the TextArea. I do not want you to press the button, and then have to wait and stare at a blank box for 15 seconds before we see all digits appear at once. You might get this in an earlier stage of the program, but you will probably need to utilize Platform.runLater() to fix this.
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