5 Replies Latest reply on Jul 23, 2013 9:01 AM by JAVA_AGM

    JavaFX support for MDI


      How can I implement MDI (Multiple Document Interface) in JavaFX? Any samples on this?

      I know that one possibility is to mix Swing and JavaFX to achieve this but is it possible without using any Swing?

      Thank you for your support.
        • 1. Re: JavaFX support for MDI
          HI user,

          I think you mean the multi-Scene Interface , if so then In javafx you can change many scenes in a single Stage so that you can swap those scene. All things in the JavaFX is customizable.

          Simple going code:
          private Scene s1,s2;
          private Stage stage;
          public void start(Stage stage) {
               this.stage = stage;
               s1 = new Scene(panel1); //Contains the first window element
               s2 = new Scene(panel2)  //Contains the second window elements
          //Anywhere in the code after certain condition matches in existing class
          this.stage.setScene(s2); //this code changes the scene of your main program Stage/Window
          For more about this you can head toward the Stage and Scene API

          • 2. Re: JavaFX support for MDI
            Hi Narayan,

            In your example there is only one scene visible at time.

            What I'm looking for is JavaFX version of Swing JDesktopPane which can serve as container for individual "child" JInternalFrames frames.
            If you minimize child frame, icon of it is located on the bottom of the container pane instead of Windows task bar.
            You can have several child frames and they can overlap each other. You cannot move child frame out of the container.


            • 3. Re: JavaFX support for MDI
              There is an old thread about JDesktopPane here: JavaFX 2 - Internal Windows

              Using Netbeans or Eclipse platform only for this purpose sounds a bit heavy solution.
              • 4. Re: JavaFX support for MDI
                Hi user,
                Currently there is nothing like that in JavaFX internal API. But you can use third party free library like JFXTras.
                They already have the VFXWindow class which helps to run the multiple window inside the window like the JInternalFrame of Swing.

                Or Alternatively you can even make the custom as well. It's all about the Layouts and the Node. :)

                Links to the VFXWindows library:
                - http://jfxtras.org
                - http://www.youtube.com/watch?v=QH_A9rWc4zg

                1 person found this helpful
                • 5. Re: JavaFX support for MDI


                  Can u please send me the implementaion details of MDI using swing in javafx.

                  It will be helpful for me.