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...

1 answer below »
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
Answered Same DayOct 07, 2021

Answer To: CS 2323 – Unit 08 HW 1) (Draw an arrow line) Write a JavaFX program that randomly draws an arrow...

Shweta answered on Oct 11 2021
148 Votes
67732/DrawArrow/build.xml

Builds, tests, and runs the project DrawArrow.


67732/DrawArrow/dist/run367080159/DrawArrow.jar
META-INF/MANIFEST.MF
Manifest-Version: 1.0
Implementation-Title: DrawArrow
X-COMMENT: Main-Class will be added automatically by build
Implementation-Version: 1.0
Permissions: sandbox
Codebase: *
JavaFX-Version: 8.0
Class-Path:
Created-By: JavaFX Packager
Implementation-Vendor: Acer
Main-Class: drawarrow.DrawArrow
drawarrow/DrawArrow$1.class
package drawarrow;
synchronized class DrawArrow$1 implements javafx.event.EventHandler {
void DrawArrow$1(DrawArrow);
public void handle(javafx.event.ActionEvent);
}
drawarrow/DrawArrow.class
package drawarrow;
public synchronized class DrawArrow extends javafx.application.Application {
public void DrawArrow();
public void start(javafx.stage.Stage);
public static void main(String[]);
}
67732/DrawArrow/dist/run367080159/DrawArrow.jnlp


DrawArrow
Acer
null











67732/DrawArrow/dist/run367080159/web-files/dtjava.js
/*
* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
/**
The Java Deployment Toolkit is a utility to deploy Java content in
the browser as applets or applications using the right version of Java.
If needed it can initiate an upgrade of user's system to install required
components of Java platform.


Note that some of the Deployment Toolkit methods may not be fully operational if
used before web page body is loaded (because DT native plugins could not be instantiated).
If you intend to use it before web page DOM tree is ready then dtjava.js
needs to be loaded inside the body element of the page and before use of other DT APIs.
@module java/deployment_toolkit
*/
var dtjava = function() {
function notNull(o) {
return (o != undefined && o != null);
}
function isDef(fn) {
return (fn != null && typeof fn != "undefined");
}
//return true if any of patterns from query list is found in the given string
function containsAny(lst, str) {
for (var q = 0; q < lst.length; q++) {
if (str.indexOf(lst[q]) != -1) {
return true;
}
}
return false;
}
/* Location of static web content - images, javascript files. */
var jscodebase = (function () {
//