Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326117

Summary: SWT_AWT bridge - SWT in Swing problem
Product: [Eclipse Project] Platform Reporter: amos <mountain14466>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: critical    
Priority: P3 CC: eclipse.felipe, ericwill, grant_gayed, Silenio_Quarti
Version: 4.7Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard: stalebug
Attachments:
Description Flags
compare window with linux none

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.