Bug 296681

Summary: Thread issue when using SWT in AWT
Product: [Eclipse Project] Platform Reporter: Paul <phewlett>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Paul CLA 2009-12-02 06:19:28 EST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729)
Build Identifier: version 3.555

Not sure if this is related to the other SWT_AWT problem.  The problem occurs at "Shell shell = SWT_AWT.new_Shell(display, canvas);".

Reproducible: Always

Steps to Reproduce:
package my.browser;

import java.awt.Canvas;
import java.awt.Color;
import java.awt.Frame;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import org.eclipse.swt.SWT;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.BrowserFunction;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class WebBrowserAWT {

    public static void main(String[] args) {
        final Frame frame = new Frame();
        frame.setSize(400, 400);
        frame.setTitle("Web Browser AWT Test");

        frame.addWindowListener(new WindowListener() {

            public void windowOpened(WindowEvent e) { }

            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }

            public void windowClosed(WindowEvent e) { }

            public void windowIconified(WindowEvent e) { }

            public void windowDeiconified(WindowEvent e) { }

            public void windowActivated(WindowEvent e) { }

            public void windowDeactivated(WindowEvent e) { }
            
        });
        
        Canvas canvas = new Canvas();
        frame.add(canvas);
        frame.setVisible(true);

        Display display = new Display();

        Shell shell = SWT_AWT.new_Shell(display, canvas);
        shell.setLayout(new FillLayout());

        Browser browser = new Browser(shell, SWT.DefaultSelection);
        GridData gridData = new GridData();
        gridData.grabExcessHorizontalSpace = true;
        gridData.grabExcessVerticalSpace = true;
        gridData.verticalAlignment = GridData.FILL;
        gridData.horizontalAlignment = GridData.FILL;
        browser.setLayoutData(gridData);

        browser.setUrl("http://www.google.com/");

        browser.refresh();
    }

}
Comment 1 Eclipse Webmaster CLA 2019-09-06 16:08:24 EDT
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.

If you have further information on the current state of the bug, please add it. 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.