In this recipe, we will install the plugins required for working with JavaFX and also create our first project that will serve as the basis for some of the next recipes.
There are two options to start working with NetBeans:
First, it is possible to download the specific IDE for JavaFX from the NetBeans site. Just go to the download section and select the JavaFX version.
Second, if NetBeans is already installed on your machine, simply open the IDE, click on Tools and Plugins, then select the following components:
And click Install.
Follow the steps of the NetBeans IDE Installer and accept a License Agreement. The NetBeans plugins will be downloaded and installed automatically. At the end of this process, the IDE will ask if you wish to restart the IDE, choose Restart IDE Now and click Finish.
When the IDE completes the installation of the plugins, it restarts and after that we are ready to go.
To Create a New Project:
NetBeans, in conjunction with JavaFX SDK, creates a project structure, assigns the necessary libraries for the project to work, and creates Main.fx
.
Main.fx
is the main class that we will be building our future applications on, and where we will place the components from the JavaFX Palette.
Note that due to NetBeans JavaFX Composer, the Main.fx
is already created and presented with the visual Components Palette and the design mode on.
Below is the file structure of our newly created project:
The JavaFX SDK provides samples of what can be done with JavaFX.
To check them out:
The list of available examples is extensive and will cover pretty much all the needed functionality and APIs that a developer might need.
Examples of these projects are:
And many more.
Just open one and start learning more about JavaFX.
3.16.218.105