| Summary: | SWT_AWT bridge - SWT in Swing problem | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | amos <mountain14466> | ||||
| Component: | Core | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> | ||||
| Status: | CLOSED DUPLICATE | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | CC: | mountain14466, remy.suen | ||||
| Version: | 3.7 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 179581 [details]
compare window with linux
compare window with linux
Is this the same problem as bug 326117? yes. It is the same as bug 326117. I am sorry for deliver it three times. You can close it. Could you give me some suggestion about 326117? how can I embed the browser into awt. *** This bug has been marked as a duplicate of bug 326117 *** Moving to SWT |
Build Identifier: I wanted to embed brower into awt canvas.I wrote public class MyBrowser{ public static void main(String[] args) { final Display display = Display.getDefault(); Frame frm = new Frame("MyBrowser"); Canvas embedded = new Canvas(); frm.add(embedded, BorderLayout.CENTER); frm.pack(); final Shell composite = SWT_AWT.new_Shell(display, embedded); composite.setLayout(new FillLayout(SWT.VERTICAL)); final Browser browser = installBrowser(composite, "http://www.baidu.com"); frm.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { e.getWindow().dispose(); //composite.dispose(); // display.dispose(); } }); JTextField addr = new JTextField(80); addr.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { display.syncExec(new Runnable() { public void run() { browser.setUrl(((JTextComponent) e.getSource()).getText()); } }); } }); frm.add(addr, BorderLayout.NORTH); frm.setSize(800, 600); frm.setVisible(true); while (frm.isDisplayable()) if (!display.readAndDispatch()) display.sleep(); // display.dispose(); } public static Browser installBrowser(Composite parent, String homeURL) { Browser browser = new Browser(parent, SWT.EMBEDDED); browser.setUrl(homeURL); return browser; } } On Windows it works, On Linux, the bridge seems to work, but nothing is visible. So I want to know how to make it work on linux. Just swt browser component is OK.When embed it into awt-canvas. it can not work My environment is :¡¡£í£ï£ú£é£ì£ì£á 1.7.7 gtk: gtk2-2.2.4-19 linux: Red Hat Enterprise Linux ES release 3 (Taroon Update 8) uname -a 2.4.21-47.ELsmp #1 SMP Wed Jul 5 20:38:41 EDT 2006 i686 i686 i386 GNU/Linux Reproducible: Always