Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2012-04-02 11:01:48 -0400
committerSilenio Quarti2012-04-02 11:02:31 -0400
commit1e5d90e101ef7cd92d8b669df51a4e5957ebbc9f (patch)
tree105579e1a6d711eee76500a5cb29ac69bf8e4745 /examples
parent8c9186f8d0fbe703a2d65541301051e2fa730c20 (diff)
downloadeclipse.platform.swt-1e5d90e101ef7cd92d8b669df51a4e5957ebbc9f.tar.gz
eclipse.platform.swt-1e5d90e101ef7cd92d8b669df51a4e5957ebbc9f.tar.xz
eclipse.platform.swt-1e5d90e101ef7cd92d8b669df51a4e5957ebbc9f.zip
Bug 375790 - [SWT_AWT] Hangs on quit on Mac OS X Lion
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet337.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet337.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet337.java
index ba78a70663..83cd73e86e 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet337.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet337.java
@@ -11,6 +11,7 @@ import java.awt.BorderLayout;
import java.awt.Canvas;
import java.awt.EventQueue;
import java.awt.FlowLayout;
+import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
@@ -64,7 +65,19 @@ public static void main(String args[]) {
mainFrame.setVisible(true);
}
});
- while (true) {
+ display.addListener(SWT.Close, new Listener() {
+ public void handleEvent(Event event) {
+ EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ Frame[] frames = JFrame.getFrames();
+ for (int i = 0; i < frames.length; i++) {
+ frames[i].dispose();
+ }
+ }
+ });
+ }
+ });
+ while (!display.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
}

Back to the top