Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326254 - SWT_AWT bridge - SWT in Swing problem
Summary: SWT_AWT bridge - SWT in Swing problem
Status: CLOSED DUPLICATE of bug 326117
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-26 02:01 EDT by amos CLA
Modified: 2010-09-27 00:42 EDT (History)
2 users (show)

See Also:


Attachments
compare window with linux (34.39 KB, image/pjpeg)
2010-09-26 02:03 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-26 02:01:43 EDT
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
Comment 1 amos CLA 2010-09-26 02:03:22 EDT
Created attachment 179581 [details]
compare window with linux

compare window with linux
Comment 2 Remy Suen CLA 2010-09-26 07:46:10 EDT
Is this the same problem as bug 326117?
Comment 3 amos CLA 2010-09-26 21:41:12 EDT
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 ***
Comment 4 Satyam Kandula CLA 2010-09-27 00:42:46 EDT
Moving to SWT