You are here
Home > Java > JavaFX HelloWorld with NetBeans and Gradle

JavaFX HelloWorld with NetBeans and Gradle

javafx-helloworld-featured

Hello Friends, Today we are going to see how to create and run JavaFX HelloWorld with NetBeans and Gradle. Actually I had developed ZatackCrawler a data scrapper tool few years ago when I was learning JavaFX. I had also shared this tool in 2017 that you can check here. But few days ago I had to use this tool but surprisingly I was unable to run this tool. Then I have done some research and found that JavaFX is removed from Java 11 but it is still available till Java 10, so this tool should work till Java 10. Because I was using Java 11 that’s why I was not able to run this tool. Then I thought to migrate this tool to Java 11 but I faced few problems while migration to JavaFX so I thought to share this HelloWorld Example. JavaFX is now maintained by gluon. I have used Gradle build tool in this example because it’s easy to put all the depedencies in single gradle file and it downloads the dependencies automatically. You can also use Maven or just add javafx jars in your libraries.

Now, Let’s Code

build.gradle

Main.java

MainApp.java



scene.fxml

SceneController.java

File Structure

javafx-helloworld-file-structure

Output

javafx-helloworld-output-1 javafx-helloworld-output-2
Output using IDE Output from Distributions folder using Terminal

NetBeans Project Download

 

Thanks friends
Your queries & suggestions are welcome in comments section
Please don’t forget to share if you find this helpful

Rajesh Kumar Sahanee
I am a passionate Java Developer and I like Computer Programming. I love to do some interesting experiments and listening music in my free time.
https://www.zatackcoder.com

Comments

zatackcoder
Top

  Â