Using JavaFX8 to Drag Connected Shapes

Objective In this example we are going to create three connected circles as per the image below: and we will be able to drag these circles around the screen using the mouse: The Code Create the class examples001.ConnectedShapes.java as follows: ConnectedShapes Run the code by right clicking on the file and selecting Run File. Reviewing the…

Using JavaFX to draw a Changing Shape

Objective In this example we are going to create a RoundedRectangle shape with two sliders as per the image below: By moving the slider inside the shape, we will change the curvature on the corners of the shape: By moving the slider underneath the shape, we will move the shape (and the slider within it)…

Create a Default JavaFX8 Application

To create tje JavaFX Examples I am going to use Netbeans 8 with Java 8. Create a JavaFX Project Open NetBeans File -> New Project -> JavaFX -> JavaFX Application Project Name: JavaFX8Examples JavaFX Platform: JDK 1.8 (Default) This will create and open the file javafx8examples.JavaFX8Examples.java JavaFX8Examples Run the Application To run the code either…

Java 8 and Lambda to Search a File

In this example we are going to read from a File and use Lambda expressions to  search out and collect every line that contains a .foreach statement. Search Within a File Note that we are also using Java NIO and try-with-resources which makes use of the AutoCloseable interface. Source Code Full source code of a…