Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326117 - SWT_AWT bridge - SWT in Swing problem
Summary: SWT_AWT bridge - SWT in Swing problem
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.7   Edit
Hardware: PC Linux-GTK
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: triaged
: 326254 326255 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-09-24 02:42 EDT by amos CLA
Modified: 2021-02-05 13:57 EST (History)
4 users (show)

See Also:


Attachments
compare window with linux (34.39 KB, image/jpeg)
2010-09-24 02:46 EDT, amos CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description amos CLA 2010-09-24 02:42:51 EDT
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
Comment 1 amos CLA 2010-09-24 02:46:23 EDT
Created attachment 179498 [details]
compare window with linux
Comment 2 amos CLA 2010-09-26 21:41:12 EDT
*** Bug 326254 has been marked as a duplicate of this bug. ***
Comment 3 Alexander Kurtakov CLA 2014-07-10 06:53:44 EDT
*** Bug 326255 has been marked as a duplicate of this bug. ***
Comment 4 Eric Williams CLA 2016-10-04 11:18:55 EDT
This bug is still reproducible on 4.7.
Comment 5 Eclipse Genie CLA 2021-02-05 13:57:56 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.