A question on functionality
Larry White
ljw1001 at gmail.com
Tue Jun 21 09:35:06 UTC 2016
Hi Robert, and Yoshi,
What I was asking about specifically is this. In the R REPL, you can write
this:
> cars <- c(1, 3, 6, 4, 9)
> plot(cars)
And a window opens and renders a plot of the array 'cars'.
I want to be able to write a library with a static method plot() that does
the same thing.
I can't see how to do this using JavaFX without making the end user write a
class that implements Application and (in it's own code), creates the cars
array before calling launch. This is because (at the API level) the only
way to open an FX window from other java code is to call the static method
void launch(String[] args);
which takes only a String[] and returns void.
What I *really* want to do, is pass 'cars' to webEngine and plot it in
Javascript. While I can wrap WebEngine in a Jframe, it seems that
initializing it ultimately has the same constraint, in that I cannot pass
it any non-string params. In other words, you have to write and launch an
application to open a window.
I will take a look at jfxframe and bitterfox, but wow, it seems very early.
thanks very much.
larry
On Tue, Jun 21, 2016 at 1:11 AM, Robert Field <robert.field at oracle.com>
wrote:
> I'm afraid I don't understand your question. You can evaluate any code
> that you can evaluate in Java. The code evaluates on a fixed thread , which
> is an issue for JavaFX but not Swing. And the event dispatch thread issue
> will be resolved.
>
> Can you give an example of what is not working.
>
> Robert
>
>
>
>
> On June 20, 2016 9:33:01 PM Larry White <ljw1001 at gmail.com> wrote:
>
> 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