Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8101052

Swing interop: app should not need to explicitly initialize the FX runtime

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P2
    • fx2.0
    • fx2.0
    • javafx

    Description

      Currently, a swing application must call Application.launch, passing in a subclass of Application. This is cumbersome and error prone. In the most recent build, I have factored this out into a dummy class in SwingJavaFXChart as follows:

          //NOTE: this method of launching the JavaFX runtime is temporary and will
          // be superseded by a method on JFXPanel itself.
          public static class TmpFxLauncher extends Application {
              @Override public void start(Stage primaryStage) {
              }

              private static void launch() {
                  Application.launch(null);
              }
          }

      This can go away as soon as we settle on exactly how we want to launch FX from JFXPanel. Regardless of how we do it, a Swing / FX interop app should not need to refer to the Application class.

      I recommend making initialization implicit when the first JFXPanel instance is constructed.

      Attachments

        Issue Links

          Activity

            People

              kcr Kevin Rushforth
              kcr Kevin Rushforth
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported: