Embedding JavaFX in Cocoa app?

steve.x.northover at oracle.com steve.x.northover at oracle.com
Tue Jan 8 08:09:15 PST 2013

Embedding in JavaFX is lightweight.  The outer toolkit (ether AWT/Swing 
or SWT) provides input to FX (mouse, keyboard etc.) and FX provides 
output (images to draw).  An embedding into a cocoa app would require 
code that does the same thing.  For example, you would write Objective-C 
code to subclass NSView, get mouse events through NSView>>mouseDown: and 
call into Java to tell FX that the mouse is down.  Essentially this 
would be adding cocoa as another embedding toolkit.

Tom is right that the code is not yet open sourced but we are working as 
fast as we can towards making it be so.


On 08/01/2013 3:28 AM, Tom Schindl wrote:
> I'd look at the how the JavaFX-SWT-Integration (FXCanvas) is done but
> I'm afraid it is not yet opensourced.
> Tom
> Am 08.01.13 09:17, schrieb Tobias Bley:
>> Hi,
>> does anybody has an idea how to embedd a JavaFX scene into a cocao app? (NSView)
>> Best regards,
>> Tobi

More information about the openjfx-dev mailing list