This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: JavaFx and the Kawa REPL




On 01/25/2016 04:43 AM, ben yakawp wrote:
This example works only when running as script, not when loaded from a
repl.

The line makes the repl unresponsive: "(javafx-application)"

Is this normal behaviour or how can I prepare the "stage" in the repl.

It's normal.  The  problem is that JavaFX (like Swing and most other
GUI toolkits) is single-threaded, and everything GUI-related must
happen on the JavaFX thread.  That is why in JavaFX programs
you'll see a lot of calls to Platform.runLater - and why it's very
easy to hang JavaFX programs if they're not carefully written.

The definitions in javafx-def are fairly simple, and make no attempt
to deal with the threading issues.  It might be worthwhile to
attempt to design a JavaFX wrapper API that makes it easier (and
less error-prone) to co-ordinate between the JavaFX thread and
one or more user threads.

I wrote a REPL based on JavaFX (using WebView): See
https://github.com/PerBothner/JWebTerminal
However, I've abandoned that project in favor of DomTerm: http://domterm.org/
I'm working om some neat REPL features using DomTerm - and I hope to
allow friendlier GUI programming from Kawa using related Web technologies.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]