Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 121467 Details for
Bug 259894
[SWT_AWT] When IE is embedded in Swing, Alt+F4 notifies twice the window listeners
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Simple test case that shows the bug.
DoubleAWTWindowEventNotificationsTest.java (text/java), 1.86 KB, created by
Christopher Deckers
on 2009-01-03 12:35:22 EST
(
hide
)
Description:
Simple test case that shows the bug.
Filename:
MIME Type:
Creator:
Christopher Deckers
Created:
2009-01-03 12:35:22 EST
Size:
1.86 KB
patch
obsolete
>package test; > >import java.awt.BorderLayout; >import java.awt.Canvas; >import java.awt.event.WindowAdapter; >import java.awt.event.WindowEvent; > >import javax.swing.JFrame; >import javax.swing.SwingUtilities; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.awt.SWT_AWT; >import org.eclipse.swt.browser.Browser; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; > >public class DoubleAWTWindowEventNotificationsTest extends JFrame { > > public DoubleAWTWindowEventNotificationsTest() { >// setDefaultCloseOperation(EXIT_ON_CLOSE); > Canvas canvas = new Canvas() { > @Override > public void addNotify() { > super.addNotify(); > final Canvas canvas_ = this; > display.asyncExec(new Runnable() { > public void run() { > final Shell shell = SWT_AWT.new_Shell(display, canvas_); > shell.setLayout(new FillLayout()); > Browser browser = new Browser(shell, SWT.NONE); > browser.setUrl("http://www.google.com"); > // The initial size is wrong so we have to force it > shell.setSize(canvas_.getWidth(), canvas_.getHeight()); > } > }); > } > }; > getContentPane().add(canvas, BorderLayout.CENTER); > setSize(400, 300); > addWindowListener(new WindowAdapter() { > @Override > public void windowClosing(WindowEvent e) { > System.err.println("Closing"); > } > }); > } > > private static Display display; > > public static void main(String[] args) { > display = new Display(); > SwingUtilities.invokeLater(new Runnable() { > public void run() { > new DoubleAWTWindowEventNotificationsTest().setVisible(true); > } > }); > while(true) { > if(!display.readAndDispatch()) { > display.sleep(); > } > } > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 259894
: 121467