Any way to embed a Swing JFrame in the AWT Frame from the SWT_AWT bridge?

三世轮回 提交于 2019-12-02 23:22:26

问题


I'm integrating a Swing application into an Bioclipse/Eclipse plug-in, and since Eclipse uses SWT, I have to use the SWT_AWT bridge somehow.

The problem is that the starting point I get from the SWT_AWT bridge is an AWT Frame, like so:

 java.awt.Frame awtFrame = SWT_AWT.new_Frame(composite);

... (which can be filled with AWT components), but the situation is that the Swing application contains much of it's functionality in it's main JFrame component. Now, a Swing JFrame can not be integrated as is into an AWT Frame.

Refactoring of the original Swing application has been discussed with the developer of the original application. Just wanted to make sure we didn't miss any obvious workaround for this?


回答1:


This is an excellent article on how to use Swing inside your SWT/RCP apps. This should be helpful.



来源:https://stackoverflow.com/questions/5502897/any-way-to-embed-a-swing-jframe-in-the-awt-frame-from-the-swt-awt-bridge

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!