O'Reilly logo

JavaFX 1.2 Application Development Cookbook by Vladimir Vivien

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Embedding Swing components in JavaFX

As explained in the Introduction of this chapter, the Swing GUI framework has evolved into a set of rich GUI components, which developers have come to love over the years. Suppose, however, you want to continue using Swing in your JavaFX application; what do you do? This recipe shows you how to use the JavaFX wrapper APIs for Swing to embed Swing components in JavaFX scripts.

Getting ready

The JavaFX Swing wrapper classes let developers embed Swing components directly into JavaFX applications. The wrapper API can be found in the package javafx.ext.swing. For this recipe, it is assumed that you are familiar with using Swing components. It will also be helpful to be familiar with JavaFX's Control API. To illustrate ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required