Qinn
Qinn

Reputation: 31

How to integrate Swing into JavaFX Applications?

I have known how to embed JavaFX content into Swing applications according to this Oracle Tutorial.

But now I want to add some Swing components to the JavaFX Scene. Is there any ideas about that?

Regards, Qin

Upvotes: 2

Views: 3016

Answers (2)

buncis
buncis

Reputation: 2513

now it's possible to do that
what you need now is install jdk 8
because swing content in javafx is introduced in jdk8

@FXML
private SwingNode swingNode;
...
JasperPrint jasperPrint = JasperFillManager.fillReport(FileName, hash, connect);
swingNode.setContent(new JRViewer(jasperPrint));

oracle just add tutorial for this too
for the next you can follow this link
oracle tutorial embed swing in javaFX

Upvotes: 3

Teocali
Teocali

Reputation: 2714

I think it is not possible in JavaFX 2.*, but some people hava worked on it. Take a look here : http://www.jroller.com/neugens/entry/embed_swing_inside_javafx_2 . Maybe you will find what you want. :)

Upvotes: 1

Related Questions