Here’s a good introduction to the JFXPanel component by Artem Ananiev, which allows for embedding JavaFX nodes into a Swing application.
It makes much more sense to use FX content in Swing, because there are so many existing Swing applications and so many exciting FX features. The good news is that using FX in Swing is now possible and, which is more important, officially supported via public API: javafx.embed.swing.JFXPanel. …More
Is it still possible for the reverse to still happen? To embed a Swing component in JavaFX. Trying to add a JPanel to a Group resulted in a method not found error since the JPanel is not a Node.
I’m asking same question.
Suppose you’re designing a fancy window (node), form, etc. in JavaFX, but your customer want to add a jtable not javafx table inside it. Is it still possible?
Here, JTable stands for a legacy component. you’ve a special jtable component doing a lot of jobs. With many special renderers, editors. You want to reuse it.
Another question, the current approach does not meet some needs such as:
You’re using a swing component listening mouse events at the background. On top of it, you’re placing a javafx container occupying whole screen (or swing component). Above picture shows the same example. Normally, you cannot click swing button, because jfxpanel will hangle events. If you delegate the event, when you click javafx button, both javafx and swing button will fire. One approach to do this, listening javafx scene and delagate the events. But the events should be converted javafx MouseEvents to awt MouseEvents. There is no easy mechanism for this. I think, this should be included in javafx.
I’m trying to same application given in the screen shot which is expressed as transparent JFXPanel feature, the jFXpanel completely covers the swing panel, i placed buttons on both panel, When i clicked on the swing button there is no action on the button, the JFXPanel blocks the mouse event and no action is triggered in the swing side.
One way can be dispacthing the mouse event to swing side from jFXPanel but with this solution, all events on the javafx is panel passed to the swing panel, that’s to say, when i click on the javafx button, the swing button is also pressed which is not a acceptable case.
am I missing something while adding jFXPanel over Swing panel?
This link would be useful to inser JavaFX API into the swing applications:
http://www.javabeat.net/2012/05/using-javafx-chart-api-to-add-charts-to-swing-applications/