• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How does JavaFx work with Netbeans - A newbie is jealous!

 
Ranch Hand
Posts: 353
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, everyone on this forum is using JavaFX.  I am wondering whether you guys are special breed. Please, have a look at my situation below.

Getting Started with JavaFX 13
JavaFX 13 and NetBeans


I have followed the above tutorial as best as I can.  Still I cannot get the simplest of JavaFX application to run.
I am using JDK-13.0.1 and the openjfx-13.0.1_windows-x64_bin-sdk with the incubating-netbeans-11.0-bin.
So now, I am dealing with three complicated things - Netbeans-11, JDK-13 and Openjfx-13 and I do not know which of them is giving the most grief.

I see that Java has its documentation and Openjfx has its documentation.
I see there is java.util and I see there is javafx.util and they do not have the same contents.
In my computer, JDK-13.0.1 and openjfx-13.0.1 are in separate locations. So, I reckon they are separate entities that happen to reside in the same computer.  Interestingly, Java does not bark at the following statement:

The question is: How does Java know about the existence of javafx.scene.control.Label?
In fact, what is the best way to "connect" Netbeans-11, JDK-13 and Openjfx-13 together so it works for everybody.  I do not understand why it works in the tutorial and it does not work for me.
 
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Biniman Idugboe wrote:I have followed the above tutorial as best as I can.  


You haven't told us where those tutorials are (such as a link or a web site) so we can't access them.

Still I cannot get the simplest of JavaFX application to run.


What happens?  Errors?  No display?  What have you tried?

I am using JDK-13.0.1 and the openjfx-13.0.1_windows-x64_bin-sdk with the incubating-netbeans-11.0-bin.
So now, I am dealing with three complicated things - Netbeans-11, JDK-13 and Openjfx-13 and I do not know which of them is giving the most grief.


I'm assuming that you can create a "Hello World" class and that it works.  This tests JDK-13.

You mention OpenJFX, so maybe you've tried this tutorial:

https://openjfx.io/openjfx-docs/#IDE-NetBeans

I'm not sure what "inclubating" in Netbeans is (a plugin?) but I would skip that for now.

I see that Java has its documentation and Openjfx has its documentation.
I see there is java.util and I see there is javafx.util and they do not have the same contents.
In my computer, JDK-13.0.1 and openjfx-13.0.1 are in separate locations. So, I reckon they are separate entities that happen to reside in the same computer.  


This all sounds fine.

Interestingly, Java does not bark at the following statement:

The question is: How does Java know about the existence of javafx.scene.control.Label?


This may mean you are using Java 8 or it may mean that incubate or Netbeans has configured JavaFX for you.

In fact, what is the best way to "connect" Netbeans-11, JDK-13 and Openjfx-13 together so it works for everybody.  I do not understand why it works in the tutorial and it does not work for me.


You need to TellTheDetails (that's a link).  We can't help you if we don't know exactly what is happening.  I would pick one thing that isn't working and explain it thoroughly.
 
Marshal
Posts: 79464
379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Biniman Idugboe wrote:Okay, everyone on this forum is using JavaFX. . . .

What makes you think that? There are many people here who don't use FX regularly or at all.
 
Biniman Idugboe
Ranch Hand
Posts: 353
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I posted to the JavaFX forum, so I assumed everyone on the forum uses JavaFX.

The tutorial I used can be found at https://openjfx.io/openjfx-docs/#install-javafx
Noticed that I did not follow step #4 exactly.  I whipped myself a couple of times and then followed the step exactly. Got the example to run. What a relief! Then I attempted to create my own application.  I placed a button and a lable on an AnchorPane via JavaFX Scene Builder. Changed the font size of the label text. Saved the file in the scr/package location.  Went back to my Netbeans project and generated the FXML file as well as the controller.  The FXML file comes up with several errors such as "Instances of javafx.scene.paint.Stop cannot be created by FXML loader".  Now I am totally lost.  

Source files are shown below:

************************************************************************************************

********************************************************************************************
 
Knute Snortum
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, if you want us to help you, please post the complete error with the stack trace and make sure the files you post match the ones you used to get the error.

I don't see anything wrong with the posted FXML or classes.
 
Biniman Idugboe
Ranch Hand
Posts: 353
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The codes I posted exactly match the ones that gave the error.  The computer in which the codes above reside is far away from me at the moment.  So, I decided to create another JavaFx application in another computer.  Unfortunately, I ran into a similar error. See the codes (the entire codes) below and the error output.
************************************************************************************

************************************************************************************

************************************************************************************

Error-in-fxml.png
[Thumbnail for Error-in-fxml.png]
Some-error-output.png
[Thumbnail for Some-error-output.png]
The-GUI.png
[Thumbnail for The-GUI.png]
 
Knute Snortum
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I still works for me.  It looks like you're using a Mac and I'm using Windows 10.  I'm using JavaFX 11.0.2.

Please don't post errors as pictures; copy and paste them into the post.
 
Biniman Idugboe
Ranch Hand
Posts: 353
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Windows Pro x64
jdk-13.0.1_windows-x64_bin
OpenJFX-13.0.1
Netbeans-11.1
************************************************************************************
Graphics Device initialization failed for :  d3d, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:244)
at javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
at java.base/java.lang.Thread.run(Thread.java:830)
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: No toolkit found
at javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
... 5 more
D:\HelloSampleFx\nbproject\build-impl.xml:1353: The following error occurred while executing this line:
D:\HelloSampleFx\nbproject\build-impl.xml:973: Java returned: 1
BUILD FAILED (total time: 2 seconds)
 
Knute Snortum
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Searching the internet for the cause of this error, it looks like it may be that you downloaded the wrong version of JavaFX jars for your OS (Windows).  I would remove the JavaFX folder and download it again.  If that doesn't work, maybe try 11.0.2 this time.
 
Rancher
Posts: 285
14
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is javaFX no longer part of java? i'm using java8 and javafx is bundled with java, i didn't download it separately or have to do any configuring to set it up as a 3rd party api.
they finally killed off javafx?
 
Knute Snortum
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By Java 9, I believe, JavaFX was unbundled from Java.   It's still maintained and OpenJFX and Gluon and it's open source, so it's not going away soon.

https://openjfx.io/
https://gluonhq.com/products/javafx/
 
Biniman Idugboe
Ranch Hand
Posts: 353
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With this unbundling, is Oracle effectively saying that if you use JavaFx, you are on your own? What graphical development tool does Oracle recommends now?
Seriously, with all these difficulties one has to go through just to get JavaFx working, one wonders whether this is a way of discouraging its use.
 
Knute Snortum
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Biniman Idugboe wrote:With this unbundling, is Oracle effectively saying that if you use JavaFx, you are on your own?


Essentially, yes. Oracle no longer supports JavaFX.  But Gluon will and there's community support.

What graphical development tool does Oracle recommends now?


Swing, I would think.

Seriously, with all these difficulties one has to go through just to get JavaFx working, one wonders whether this is a way of discouraging its use.


I don't think it was some evil plan, but it's true that getting things set up is harder now.
 
S Fox
Rancher
Posts: 285
14
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
for my next desktop app i'm going to try C/C++ and use the Qt api for making the gui. i've been talking to some professional developers and that's what they're using for their desktop apps. i'm looking to get the benefit of native code over JVM, and maybe better gui components too. i'm not that concerned about lack of support from oracle since they never put a lot of support into javaFX to begin with.

javaFX has been able to do most of what i want, but for formatting text it's severely lacking and an addon like RichTextFX is needed. these missing features need to be directly added into javaFX if it's going to be further developed.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic