JAVA FX - A New Web Development Experience

JavaFX has been out for a couple of weeks now and the response has been great. Clearly there are bugs to work on and features to add, but the core is powerful and ready to go. One feature I've gotten lots of requests for is the ability to mix Swing with JavaFX code and graphics. The JavaFX samples page has an example of how to embed an existing Swing component or panel in your JavaFX application. However, we don't have an example of how to do the reverse: embed a JavaFX scene in your Swing application. I asked Rich and Jasper about this and they had the same need as well. After a long train ride to Devoxx this is the code they came up with.

First things first: What I'm about to show you is a hack. It is completely unsupported, uses private APIs, and almost certainly will break in the next version. However, if we see a lot of interest we may add a permanent supported API in a future release of JavaFX, so let us know what you think of it. Second, this is a hack. Most likely not all features of JavaFX will work in this scenario and we haven't done any more than trivial testing. Don't go building a production application using this technique

Comments

Join as a footSigns Travel Writer...

Name

Email *

Message *