Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a JavaFX Application that allows the user to draw (scribble) on the scene by dragging the mouse. In the upper-left corner, provide a button

Write a JavaFX Application that allows the user to draw (scribble) on the scene by dragging the mouse. In the upper-left corner, provide a button to clear the scene and a color picker to choose the current drawing color. The button should be labeled "Clear scene". Hint: Use the standard JavaFX ColorPicker. (Or if you already wrote one earlier, you could use your own version). Hint: Add a new Polyline to the scene each time the mouse button is pressed down. As the mouse is dragged, add points to current Polyline, and draw the current Polyline using the color the user chose in the ColorPicker. This way, the user can draw a bunch of lines with different colors. Hint: To store all those Polylines the user is making, create an array of Polylines as an instance variable of the Application you are creating. Make the array big enough (say size 100) so that it would accommodate most any user's needs. Hint: When the user hits the "Clear scene" button, iterate through all the Polylines in the array, remove each from the Scene and store a null value in the array.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions