Multiple JFXPanel?
Anton V. Tarasov
anton.tarasov at oracle.com
Wed Aug 7 07:39:54 PDT 2013
Hi Pedro,
On 05.08.2013 2:13, Pedro Duque Vieira wrote:
> Hi Anton,
>
> Thanks for your reply.
>
> Actually I wasn't clear enough when I explained my app.
> My app is composed of a MDI style interface but each window belongs to the same JFrame, so there
> is only one JFrame but multiple internal frames. One of these internal frames has a JFXPanel with
> a scene in it. I intend to migrate the rest of the internal frames to javafx one by one using this
> approach.
Sorry, I didn't get it.
>
> My question was is this a viable way to do this? Or am I going to pay a performance penalty from
> having multiple JFXPanels (hence multiple scenes) inside the same app (the same JFrame)?
Actually, it doesn't matter for an embedded scene where you embed it, to a separate frame or to an
internal one. In both the cases the embedded scene will have the same machinery behind.
Just for curiosity, I've modified my testcase to be MDI like and got the same performance scores.
So, your case should not bring any additional performance decrease, except for the difference b/w
your fx & swing implementations which may depend.
Thanks,
Anton.
>
> From what people have told me in this mailing list, they are using multiple JFXPanels without any
> significant performance penalty, anyway it would be interesting hearing the opinion from you,
> JavaFX dev team guys.
>
> Thanks once again for your replies, best regards,
>
> On Fri, Aug 2, 2013 at 8:55 AM, Anton V. Tarasov <anton.tarasov at oracle.com
> <mailto:anton.tarasov at oracle.com>> wrote:
>
> Hi Pedro,
>
> I've made the following experiment. I've created two simple test cases: one is pure fx stage
> showing WebView which animated some guimark2 benchmarks, another one is the same WebView
> wrapped with JFXPanel put in JFrame.
>
> I ran each test case with a single, two or four toplevels (Stages or JFrames, appropriately)
> and measured performance difference. I noticed that for the swing test case, adding more
> toplevels decreased performance with the same proportion like the fx test case did (despite
> the fact that fx performed relatively faster, of course). For instance, for the Vector
> Charting Test the ratio was directly proportional to the number of toplevels, that is doubling
> the toplevels decreased performance by two times equally for both fx and swing cases.
>
> This more or less proves the fact that adding another embedded scene into your app doesn't
> bring anything except another scene.
>
> Thanks,
> Anton.
>
>
> On 01.08.2013 2:45, Pedro Duque Vieira wrote:
>
> Hi,
>
> I have a doubt. I have a swing app with embed javafx scene. My app has kind
> of a MDI style interface. Right now only one window has been converted to
> JavaFX, basically it's a window with a JFXPanel in it.
> My question is if I want to convert the other windows as well should I also
> put a JFXPanel in them? I would than have 2 JFXPanels in my app, does that
> mean I would have 2 JavaFX scenes? Is that the way to do it? Would that
> seriously hurt performance?
>
> Thank you in advance, best regards,
>
>
>
>
>
> --
> Pedro Duque Vieira
More information about the openjfx-dev
mailing list