JavaFX line chart example

In this example we will see how to create line chart with JavaFX. We are using LineChart. In the begging we will create two NumberAxis for X and Y coordinates. We will pass them to the constructor of LineChart. Then we will create XYChart.Series object representing series of data. We will use ObservableList and we … Read more

JavaFX example of a MP3 player

This is a simple example of a mp3 player created with JavaFX. It has a button to open and play the track, pause, resume and stop buttons with their respective functionalities. To play the music we use MediaPlayer class -> The MediaPlayer class provides the controls for playing media. MediaPlayer provides the pause(), play(), stop() … Read more

Java FX example of a TO DO list

Simple Java FX application which creates and removes elements from the list. This is a basic example of a To Do List application using JavaFX. The program creates a window with a text field for inputting new tasks, a list view for displaying the tasks, and two buttons for adding and removing tasks. The tasks … Read more

Java FX Example of simulate Earth going around the Sun

In this example we will use Java FX and create animation in which Earth will go around the sun: Maven pom.xml dependencies of JavaFX: Java code: This program creates a simple animation of the Earth going around the Sun using the JavaFX library. The animation is created using a PathTransition object, which animates a node … Read more