JFXPanel

John Smith John_Smith at symantec.com
Fri Dec 21 12:13:59 PST 2012


> Canvas is sort of close to what is needed, but it fails completely for my use case and simply crashes the app because it runs out of memory.  The FX Thread doesn't service the changes to the canvas fast enough for me to paint live video into the canvas.

I used Canvas (and WritableImage) for doing 1024x1024px animations at 60fps and it did not crash or run out of memory.  The FX Thread serviced the changes fast enough for smooth animation.  Others have displayed smooth 1920x1080 full screen video using Canvas (see https://forums.oracle.com/forums/thread.jspa?threadID=2434712).  The PixelFormat used for the WritableImage can make a huge difference to performance.

-----Original Message-----
From: openjfx-dev-bounces at openjdk.java.net [mailto:openjfx-dev-bounces at openjdk.java.net] On Behalf Of Scott Palmer
Sent: Friday, December 21, 2012 6:46 AM
To: Artem Ananiev
Cc: openjfx-dev at openjdk.java.net
Subject: Re: JFXPanel


On 2012-12-21, at 8:41 AM, Artem Ananiev <artem.ananiev at oracle.com> wrote:

> Hi, Scott,
> On 12/21/2012 7:00 AM, Scott Palmer wrote:
>> 
>> On 2012-12-17, at 5:55 AM, Artem Ananiev <artem.ananiev at oracle.com> wrote:
>> 
>>> 
>>> On 12/14/2012 8:19 PM, Werner Lehmann wrote:
>>>> Scott,
>>>> 
>>>> JFXPanel has quite a few issues (look for JFXPanel or Swing in Jira).
>>>> Among those is the filechooser problem. It is probably just one 
>>>> instance of the problem that a JavaFX stage cannot be modal or on 
>>>> top of Swing windows.
>>> 
>>> Yes, z-order and modality problems with Swing and FX top-level windows is a known issue. Unfortunately, I don't know a good way to fix it: AWT/Swing doesn't expose enough information to use its windows as owner windows for other UI toolkits.
>>> 
>>> Thanks,
>>> 
>>> Artem
>> 
>> 
>> I responded earlier wondering why the native window handle of the Swing Window wasn't acquired via the publicly available jawt native methods so it could be used as the parent for a Stage or worked into some sort of hierarchy to give a proper parent window to FX Stages and dialogs.   I didn't see any response.  Am I missing something?
> 
> I replied to your proposal about JAWT the very next day, Dec 18. Please, let me know if I need to resend my email.

I found it... not sure how I missed it the first time, but GMail has it in this thread.  Sorry.

> 
> Note that JAWT is not only about getting native handles, but more related to direct rendering to AWT components like Canvas. In FX, the rendering model is completely different, and FX doesn't use heavyweight components (Panel, Canvas), so the only rendering surface we can expose is the window itself.
> 
> Thanks,
> 
> Artem

Canvas is sort of close to what is needed, but it fails completely for my use case and simply crashes the app because it runs out of memory.  The FX Thread doesn't service the changes to the canvas fast enough for me to paint live video into the canvas.  If there was some more direct way to paint into an image's backing store, that might work.  Or even some special Canvas/Image that gave me access to a native graphics context (OpenGL texture or DirectDraw surface for example).  I've also asked for access to a mechanism to provide my own raw image data to the media APIs, so it could somehow fit in to the existing video playback support.


Scott


More information about the openjfx-dev mailing list