I start to learn Clojure, and I want to try JavaFX for GUI. I found this article:http://nailthatbug.net/2011/06/clojure-javafx-2-0-simple-app/
, but I want to start it via repl for fast testing and convenience.
So, for instance, I can write in repl this and see new window:
(defn main-start []
(doto (JFrame. "Window!")
(.setSize (java.awt.Dimension. 400 300))
(.setVisible true)))
Is there any way to do such thing with javafx.application.Application – to see new JavaFX window?
Thx. Andrew.
Though it’s still in its infancy, I’ve been able to use JavaFx from the REPL using Upshot. The main trick is just to completely ignore
Applicationand create your scene directly. To do this you need only force the runtime to initialize and example of which can be seen at core.clj:69. The other trick is that almost everything you do has to be wrapped in arun-nowblock to ensure it runs on the JavaFX thread. JavaFX is much more picky about threading than Swing.