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

Add Application launching support for dynamic languages

XMLWordPrintable

      In languages like Clojure the current way to launch JFX Apps is cumbersome. To be able to get started with JFX I first had to write Java code: a proxy class, that offers a static method m which takes a Runnable r which contains my Clojure code and which gets stored in a static class field. Then m calls Application.launch(new String[0]); to get to the start() method in which the Stage s also gets stored in a static class field, after which r.run() gets called which finally executes my code. In that code I then have to access the static field s to have something to which I can add content, and only then I was able to dive into JFX.
      So, please add a static method Application.launchEmptyStage() that returns the primary Stage.

      Then the experience for Clojure users would be:
      (def stage (Application/launchEmptyStage))
      ==> works, I now can code JFX!

      Same probably applies to JRuby as well. I saw that the JRuby example you gave included a proxy class...

            Unassigned Unassigned
            athiemejfx Andre Thieme (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Imported: