开发者

Mixing JavaFX and Swing

开发者 https://www.devze.com 2023-03-07 01:58 出处:网络
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

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消