Inside SWT

Saturday, October 01, 2011

JavaOne

I'm speaking at JavaOne this year with Artem Ananiev. The title of the talk is "Using JavaFX 2.0 UIs with Swing and SWT". I've worked with Artem in the past but never actually met him. That's always cool.

Most of the hassles around interop with Swing and SWT were around threading. It was possible to embed one toolkit in the other, but programmers needed to be very careful to avoid deadlock. The rule of thumb was, "never wait" and use asyncExec() and invokeLater() to communicate between the two.

I'm happy to say that FX and SWT have no such hassles. Both are apartment threaded and share the same apartment.

Steve

8 Comments:

  • Can you post your slides for those of us who are not at JavaOne? I'd like to include SWT/JavaFX integration into my e(fx)clipse tooling to get a live preview of fxml-Files

    By Blogger Tom, at 2:10 AM  

  • Sure ... after the talk.

    By Blogger Steve, at 3:38 PM  

  • Any news on when your slides might be available (and maybe where from)? I keep checking Oracle's JavaOne materials site, but, although there's a listing for your talk, there are no slides associated with it.
    Thanks!

    By Anonymous Anonymous, at 11:14 PM  

  • I am very interested in seeing the slides and viewing/trying out code snippets.

    By Blogger harpal, at 2:17 PM  

  • Still no progress on the slides after a couple of months. What's the hold up? Is there anything we can do (e.g. bug a marketing person)?
    Thanks.

    By Anonymous Anonymous, at 8:46 PM  

  • Hi Steve - is there any chance of publishing the slides, or giving a rough hint of the way you integrated JavaFX into SWT? Going via JFXPanel with SWT_AWT/Albireo is somewhat slow - if you've got a better way of natively hosting in SWT without those wrappers and headaches I am be keen to learn more! Many thanks.

    By Blogger James Fry, at 7:02 AM  

  • Hi everyone,

    The slides are here: https://oracleus.wingateweb.com/published/oracleus2011/sessions/22123/interop_2-no-notes.pdf

    I'm very sorry that this took so long. The support for SWT interop with FX will be shipping in JFX 2.0.2. The class name has changed to FXCanvas but the API is the same

    By Blogger Steve, at 12:43 PM  

  • Hi Steve, thanks for posting those. In your slides you say performance within JFXPanel is comparable to native JavaFX. Is this on a particular platform? On Windows XP with Java 1.6.0_29, a Core2 3ghz and a cheap nVidia GeForce 210 card there is a noticeable rendering speed drop.

    The SWTFXPanel is very interesting though - thanks for posting, and look forward to digging into it to see what's going on! Cheers.

    By Blogger James Fry, at 1:59 PM  

Post a Comment

<< Home