I'm wanting to use a few JavaFX components in a Swing app (notably JFXPanel for its HTML 5 rendering support). My app is currently set up in Eclipse 4.3 (Kepler) and I have the latest Java 7 JDK installed on my machine.
This tutorial from Oracle suggests that all you have to do is just refer to a JavaFX class and it'll work in a Swing app. So I type in JFXPanel panel = new JFXPanel()
, but Eclipse does not recognize it as a valid Java class. It does recognize other Java 7 classes, like java.nio
.
I can't figure out how to get Eclipse to recognize JavaFX classes. This question was previously answered about JavaFX in Eclipse. The first response said that you need to start by creating a new JavaFX project, which I can't do because I already have a fairly developed Swing app. The second is to use the e(fx)clipse plugin, but the tutorial also seems to require this. If there's something special I have to do in order to get a non-JavaFX project in Eclipse to use JavaFX classes, I can't figure out how to do it.