A question on functionality
ShinyaYoshida
bitterfoxc at gmail.com
Tue Jun 21 05:05:25 UTC 2016
Hi Larry,
You can open the window with Swing directly using the plain jshell.
(But it will not executed in the Swing thread, so you should be careful!)
For the JavaFX, you cannot execute it from plain jshell, due to JavaFX
checks that it's already initialized and executed from the JavaFX thread as
you pointed out.
Please use jfxshell which is the extension tool of jshell and can execute
JavaFX code:
https://bitbucket.org/bitter_fox/jfxshell/overview
In the following example, using jdk9b122.
$ wget https://bitbucket.org/bitter_fox/jfxshell/downloads/jfxshellb122.zip
$ unzip jfxshellb122.zip
$ PATH/TO/jdk9b122/bin/java -Xpatch:jdk.jshell=jfxshellb122/jdk.jshell -m
jdk.jshell/jdk.internal.jshell.tool.JShellTool
| Welcome to JShell -- Version 9-ea
| For an introduction type: /help intro
jshell> Stage s = new Stage()
s ==> javafx.stage.Stage at 1d29cf23
jshell> s.show() // the window will be opened
jshell>
Regards,
shinyafox(Shinya Yoshida)
2016-06-21 13:32 GMT+09:00 Larry White <ljw1001 at gmail.com>:
> My apologies in advance if this is the wrong forum. If there's a better
> place for this kind of question, please let me know.
>
> Will it be possible to open a window (Swing or JavaFX) from the REPL
> initialized with data from the REPL? I'm specifically asking about the
> ability to initialize it with arbitrary data (as opposed to a string array
> passed through main() or the JavaFX launch() method).
>
> Alternately, will there be a way to open a window such that the method
> called to open it, returns a reference that can be used to pass data that
> can be displayed?
>
> My use case is to manipulate some data, then open a window to display a
> plot, as is common in an R or Python REPL.
>
> Thank you very much.
>
> larry
>
More information about the kulla-dev
mailing list