Embedding Swing/SWT/Native inside JavaFX

Tom Schindl tom.schindl at bestsolution.at
Thu Jul 25 01:23:11 PDT 2013


Hi,

IMHO the result of mixing 2 toolkits will always make your application
look alien which is more true for JavaFX and SWT than for Swing because
the L&F of each and every control looks native for the SWT-Part and
JavaFXish for the FX stuff.

I've also noticed resizing delays when using the FXCanvas integration
(haven't tested in latest builds!). To me the only thing that makes
sense to integrate is charts and diagramm stuff.

Anyways I agree with Marios proposal, write new stuff in FX, embed them
in an Eclipse4-SWT app and step by step port your SWT-Code. For menus,
Toolbars, ... this is already done by e(fx)clipse e4 runtime, so you are
only left with the inner parts of your views/editors.

Tom

On 25.07.13 10:10, Mario Torre wrote:
> But you can probably render the swt widgets into a buffered image.
> 
> I'm not sure how swt works, I need to look at it, but it should be possible
> to create a proxy peer component that takes care of all the windowing state
> and delegate rendering to swing/jfx.
> 
> Of course, its a lot of work...
> 
> I suggest instead to start developing anything new in javafx and and embed
> this into the existing platform.
> 
> Cheers,
> Mario
> Il giorno 25/lug/2013 09:56, <steve.x.northover at oracle.com> ha scritto:
> 
>> This is correct.  Due to heavyweight / lightweight issues, embedding SWT
>> in FX is not really on the table.
>>
>> Steve
>>
>> On 24/07/2013 2:55 PM, Tom Schindl wrote:
>>
>>> You can not embed a heavyweight toolkit (SWT) into a lightweight (JavaFX)
>>> one as far as i know.
>>>
>>> I've investigated doing an SWT port which uses JavaFX under the covers
>>> but without major funding this won't be proceeded (at least) by us.
>>>
>>> Tom
>>>
>>> Von meinem iPhone gesendet
>>>
>>> Am 24.07.2013 um 20:36 schrieb "Reto Urfer" <reto.urfer at pop.agri.ch>:
>>>
>>>  Hi
>>>>
>>>>
>>>>
>>>> In FX8 a SwingNode is avalable to integrate old legacy Swing code into a
>>>> new
>>>> JavaFX based application.
>>>>
>>>>
>>>>
>>>> We currently have an Eclipse 3 RCP application with some embedded Swing
>>>> parts. For the Migration to the Eclipse 4 platform it could be
>>>> interresting
>>>> to use FX instead of SWT because we heavily use theming which is mach
>>>> better
>>>> supported in FX.
>>>>
>>>>
>>>> But this implies that it is possible to embed Swing AND SWT components
>>>> into
>>>> an FX based application because we can not rewrite the existing SWT parts
>>>> with FX now.
>>>>
>>>>
>>>>
>>>> Are there any plans to provide a SWTNode to embedd SWT components int
>>>> JavaFX
>>>> like the SwingNode does for Swing components?
>>>>
>>>>
>>>>
>>>> regards
>>>>
>>>> Reto
>>>>
>>>>
>>>>
>>>> ------------------------------**------------------------------**
>>>> ----------------
>>>> -------
>>>>
>>>> Reto Urfer
>>>>
>>>> Mülligerstrasse 1
>>>>
>>>> CH-5413 Birmenstorf
>>>>
>>>>
>>>>
>>>>
>>



More information about the openjfx-dev mailing list