8154594: JFrame.setDefaultCloseOperation is prohibited in jtreg: Missing part of the fix
Reviewed-by: alexsch, prr
--- a/jdk/test/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/button/ButtonDemo.java Wed Jul 05 21:38:12 2017 +0200
+++ b/jdk/test/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/button/ButtonDemo.java Mon Apr 25 16:29:50 2016 -0700
@@ -36,6 +36,7 @@
import com.sun.swingset3.DemoProperties;
import com.sun.swingset3.demos.JHyperlink;
+import java.lang.reflect.InvocationTargetException;
/**
*
@@ -210,10 +211,10 @@
return panel;
}
- public static void main(String args[]) {
+ public static void main(String args[]) throws InterruptedException, InvocationTargetException {
final ButtonDemo buttonDemo = new ButtonDemo();
- javax.swing.SwingUtilities.invokeLater(() -> {
+ javax.swing.SwingUtilities.invokeAndWait(() -> {
JFrame frame = new JFrame(DEMO_TITLE);
frame.add(buttonDemo);
frame.pack();
--- a/jdk/test/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/tabbedpane/TabbedPaneDemo.java Wed Jul 05 21:38:12 2017 +0200
+++ b/jdk/test/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/tabbedpane/TabbedPaneDemo.java Mon Apr 25 16:29:50 2016 -0700
@@ -91,7 +91,6 @@
public static void main(String[] args) {
JFrame frame = new JFrame(DEMO_TITLE);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(new TabbedPaneDemo());
frame.setPreferredSize(new Dimension(800, 600));
frame.pack();
--- a/jdk/test/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/window/WindowDemo.java Wed Jul 05 21:38:12 2017 +0200
+++ b/jdk/test/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/window/WindowDemo.java Mon Apr 25 16:29:50 2016 -0700
@@ -31,6 +31,7 @@
import com.sun.swingset3.DemoProperties;
import com.sun.swingset3.demos.DemoUtilities;
+import java.lang.reflect.InvocationTargetException;
/**
* @author aim
@@ -145,8 +146,8 @@
}
}
- public static void main(String args[]) {
- EventQueue.invokeLater(() -> {
+ public static void main(String args[]) throws InterruptedException, InvocationTargetException {
+ EventQueue.invokeAndWait(() -> {
JFrame frame = new JFrame();
WindowDemo demo = new WindowDemo();
frame.add(demo);