Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mixing JavaFX and Swing

Tags:

java

swing

javafx

i am writing a desktop application and i like to use swing components since javafx doen't provide a tabbedpane component. I can embed my custom swing component with SwingComponent.wrap(swingComp); So i have a swing tabbedpane which accepts swing components as child items. These child items are swing components too and they have two properties, title and content. Title is a string but content is a swingcomponent. How can i embed a javafx container again in those swing tabs? Thanks in advance.

like image 539
eyurdakul Avatar asked Dec 14 '25 14:12

eyurdakul


1 Answers

I suspect that once you go from JavaFX to Swing using the wrap method, you can't return to JavaFX.

You probably need to specify a JPanel, then add the JTabbedPane to the JPanel. Your content would reference the JPanel.

like image 157
Gilbert Le Blanc Avatar answered Dec 17 '25 21:12

Gilbert Le Blanc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!