How can use javafx11 jdk11 with jme3?

how can use javafx11 jdk11 with jme3?

1 Like

java.lang.ClassCastException: class com.jme3.system.lwjgl.LwjglDisplay cannot be cast to class com.jme3.system.lwjgl.LwjglWindow (com.jme3.system.lwjgl.LwjglDisplay and com.jme3.system.lwjgl.LwjglWindow are in unnamed module of loader ‘app’)
at com.jayfella.jme.jfx.injme.util.JmeWindowUtils.getWidth(JmeWindowUtils.java:58)
at com.jayfella.jme.jfx.injme.JmeFxContainerImpl.fitSceneToWindowSize(JmeFxContainerImpl.java:561)

i use lwjgl2 not 3

i lost my cursor when i use lwjgl3.

You must use LWJGL3.

You probably(?) need to set:

flyCam.setDragToRotate(true);

in the end, i use jfx-embedded,because i am do a editor! but the problem is the jme fps is 60! the EditorFxImageView in javafx like only 5 fps! I should refresh it manually in javafx?

It is slower than normal. The size of the imageview will directly affect performance.

jmonkeybuilder dont use imageview

Yes it does.

bind(jmeApplication, scene.getCanvas(), jmeApplication.getViewPort()); jmonkeybuilder use canvas

…which is an ImageView.

ok! so how can improve EditorFxImageView fps to 60fps?

Don’t make it full-screen. Limit the size to what you need, or take control of the scene and only update it when necessary to avoid redrawing where necessary.

it is bad, i just use 800x600 ! and the fps like 5!

There are many other options. For me I can create a 1280x720 with over 300fps. It depends on your PC specifications.

  • JavaFx as a GUI inside JME.
  • Just use JME without JavaFX.
  • JME embeded into Swing.
  • Just use JME as normal.

jMonkeyBuilder fps is low ?

I have no idea. I’ve never used it. I would guess it would be the same since it uses the same system.

i use the jMonkeyBuilder lib jme3-jfx is ok! the fps is high than 60fps! and the size is 1600*900

If you can fix the issue I will add it to the repository.