Creating an Executable jar from Maven based JavaFX Project | JavaFX Tutorial for Beginners

In this tutorial, I have described the process to export an executable jar with dependency from a maven-based JavaFX project. I have used the sample project from my previous tutorial “How to create a maven-based JavaFX project”. If you want to learn, please follow the link given below. *Tutorial: How to create a maven-based JavaFX … Read more

Creating Horizontal BarChart in JavaFX with FXML | JavaFX Chart Tutorial for Beginners

In this tutorial, we will learn to create a horizontal bar chart in JavaFX. Basically, we will convert a vertical bar chart into a horizontal bar chart.    I would suggest watching the first tutorial to create a bar chart in JavaFX with fxml. https://www.youtube.com/embed/MDPim9o0BuU If you find this tutorial useful, so please hit like … Read more

Creating a Stacked BarChart in JavaFX with Fxml | JavaFX Tutorial for Beginners

In this tutorial session, we will learn to create Stacked BarChart in JavaFX with FXML.   Important components of Stacked BarChart Chart :    1) X and Y-Axis 2) X and Y-Axis Labels 3) Series of data (more than one) 4) Legends 5) Title Steps to Create a Stacked Bar Chart: ************************************ 1) First Create … Read more

How to set background color and image for the JavaFX chart?

In this tutorial, you will learn to set background color and image for a JavaFX chart. Important concept: All JavaFX charts have common properties which we can set by  .chart,  .chart-content,  .chart-title, and  .chart-legend CSS classes.  JavaFX line chart with FXML: https://youtu.be/0_TeHv2Q1PI – How to apply CSS on the JavaFX stage? https://youtu.be/81b_qNDF6Yg If you find … Read more

Setting a Background Color for a JavaFX Chart Plot

By default, we have light and dark gray grids on the chart plot. But we can change it easily with help of CSS. In this tutorial, we will set background colors and alternate colors for grids. .chart-plot-background { -fx-background-color: #e2ecfe; } .chart-vertical-grid-lines { -fx-stroke: #3278fa; } .chart-horizontal-grid-lines { -fx-stroke: #3278fa; } .chart-alternative-row-fill { -fx-fill: #99bcfd; … Read more

Setting Alternative Colors for the Series in a JavaFX Line Chart

By default, the Caspian style sheet defines eight colors of line that correspond to the first eight series of data. When the number of data series added to the line chart exceeds eight, the color of the extra lines is defined in the .chart-series-line CSS class. Use the .chart-series-line class and .default-color i.chart-series-line classes to … Read more