Question: You are expected to implement a scene application with 2 collections (javafx.scene.shape.Sphere objects) with the Java FX program. In this application, the red ball is
You are expected to implement a scene application with 2 collections (javafx.scene.shape.Sphere objects) with the Java FX program. In this application, the red ball is the master (master) and the blue ball is the slave (slave). The red ball can be dragged by holding it with the mouse, and while dragging it draws a red trail (javafx.scene.shape.Path). When we click the mouse again (Mouse pressed), the existing trace is deleted and the new trace starts to be drawn. The behavior of the blue ball should be as follows. When the red ball is dragged by the mouse, the blue ball must move symmetrically relative to the center of the stage in synchronization with the red ball. The movement of the blue ball must be symmetrical with respect to the center of the stage relative to the movement of the red ball, as shown in the picture. (The red ball should go down, the blue ball should go up while it goes left should go right, etc.). The blue ball cannot be dragged by itself, it only moves by the user dragging the red ball (symmetrical according to the movement of the red ball).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
