n/a
CS 2323 – Unit 08 HW 1) (Draw an arrow line) Write a JavaFX program that randomly draws an arrow line when the Draw a Random Arrow Line button is clicked, as shown in the figure below.. Hint: See Programming Exercise 14.20 on how to draw an arrow line. 2) (Move overlapping rectangles) Write a JavaFX program that displays ten rectangles. The width and height of each rectangle are 150 and 100. The stroke color and fill color of each rectangle are black and white. Each rectangle is initially centered at a random location on the pane. You can drag and drop a rectangle freely to a new location, as shown in Figure 15.18.The dragged rectangle now becomes the last child in the pane’s child list so it is displayed on top of the view. Implement it using mousePressed and mouseDragged. Upon mousePressed, display the selected rectangle to the top view. Upon mouseDragged, move the rectangle in the top-view. The rectangle in the top-view is the last node in the pane’s children list. Grading Criteria RandomArrow 1.0 Display JavaFX Window with Button 1.0 React when button pressed 1.0 Draw random Arrow 1.0 Documentation Rectangles 1.0 Display JavaFX Window with 10 rectangles 1.0 Detect when mouse clicked on rectangle 1.0 Move selected rectangle to the front 1.0 Documentation