This is a non-modular, Gradle-based project skeleton for creating JavaFX applications.
It uses JavaFX 20.0.2
, and includes the Gradle Wrapper (no need to install Gradle locally).
- JavaFX-aware coding assistance (code completion, search, navigation in JavaFX-specific source files)
- Logging with Logback.
- Support for FXML.
- Access to JavaFX's JavaDoc from within your IDE.
- Download this repository as
.zip
file. - Unzip the downloaded
javafx-template-main.zip
file. - Add the extracted files to your GitHub repo (if you already have one)
- Open the project with NetBeans
- Using NetBeans, build the project to download/resolve the dependencies
- Change the project name in
settings.gradle
- Rename the default Java package
edu.vanier.template
toedu.vanier.projectname
inMainApp.java
andMainAppFXMLController.java
. - Change the value of the
mainClass
class property inbuild.gradle
. A fully-qualified name of the class containing the main method that you want to run must be supplied.
If you have a project that contains multiple main
methods, then you need to change the value of the mainClass
property in the build.gradle
file. The fully-qualified name of the class that contains the main method to be executed must be specified.
The mainClass
property is declared in the application section (shown below). Note that //
can be used for inserting a comment line.
application {
mainClass = 'edu.vanier.template.MainApp'
//mainClass = 'edu.vanier.tests.Driver'
}
This project template was tested with NetBeans 17
and JDK 18
.