JavaFX embedded in jme3

http://docs.gluonhq.com/javafx11/#maven

Hi! I look GitHub - JavaSaBr/JME3-JFX: JFX Gui bridge for JME with usefull utilities for common usecases. I added in my test project - works. two question.

  1. How add fxml?
  2. what better between (main difference) GitHub - JavaSaBr/JME3-JFX: JFX Gui bridge for JME with usefull utilities for common usecases and your lib?)

it’s my lib, I don’t understand the question :slight_smile:

Parent root = FXMLLoader.load(getClass().getResource("fxml_example.fxml"));

I mean GitHub - empirephoenix/JME3-JFX: JFX Gui bridge for JME with usefull utilities for common usecases and GitHub - JavaSaBr/JME3-JFX: JFX Gui bridge for JME with usefull utilities for common usecases /:slight_smile:

Sorry, I am stupid. Went to study javafx :sweat_smile:

I support LWJGL3 and java 8/10

1 Like

Hello. tell me please how to make popup,modal windows? Standarts methods doesn’t works. ( http://code.makery.ch/blog/javafx-dialogs-official/ )
I have errors:

Uncaught exception thrown in Thread[main,5,main]
IllegalStateException: Not on FX application thread; currentThread = main

I search RlibFX/AbstractPopupDialog.java at master · JavaSaBr/RlibFX · GitHub but I can not understand how to use it.
sorry for the simple questions, I just studying and on this topic (jmonkey + javafx), and in the Internet!

UPD:
I can make button which open windows , but windows open in WINDOWS not in game

        Stage stage;
        Parent root;
        stage = new Stage();
        root = FXMLLoader.load(getClass().getResource("/utils/lol.fxml"));
        stage.setScene(new Scene(root));
        stage.setTitle("My modal window");
        stage.initModality(Modality.APPLICATION_MODAL);
        stage.initOwner(on_off_grid.getScene().getWindow());
        stage.showAndWait();

fx

Hello again! I can with GitHub - JavaSaBr/JME3-JFX: JFX Gui bridge for JME with usefull utilities for common usecases make embeddedWindow :expressionless: it’s cooly but not a window what I want, because it doesn’t have close button, and doesn’t move )

    jmeFxContainerImpl = JmeFxContainerImpl.install(this.app, this.app.getGuiNode());

    JmeFxHostInterface jmeFxHostInterface = new JmeFxHostInterface(jmeFxContainerImpl);
    EmbeddedWindow embeddedWindow = new EmbeddedWindow(jmeFxHostInterface);

    try {
        root2 = FXMLLoader.load(getClass().getResource("/utils/lol.fxml"));
    } catch (IOException e) {
        e.printStackTrace();
    }

    Scene scene2 = new Scene(root2, 100, 100);
    scene2.setFill(Color.TRANSPARENT);
    embeddedWindow.setScene(scene2);
    Group rootNode2 = new Group();
    jmeFxContainerImpl.setEmbeddedWindow(embeddedWindow);
    jmeFxContainerImpl.setScene(scene2, rootNode2);

After I can with GitHub - empirephoenix/JME3-JFX: JFX Gui bridge for JME with usefull utilities for common usecases make test window and main UI. But
for some reason move window slows down (in Test example with this lib it is similar)
link on slow move window

WOW! I Found this post [SOLVED] JME-JavaFX scene synchronization problem - #18 by zissis . JavaFX windows outside Window JME3! Strange ui…

you don’t need to create a “dialog” in your case, you can implement a control which looks like a “dialog”, I think I will create some examples of this on this week in my RlibFX library.

It’s greate! Waiting example code, big please :slight_smile:

1 Like