8154594: JFrame.setDefaultCloseOperation is prohibited in jtreg: Missing part of the fix
Reviewed-by: alexsch, prr
This commit is contained in:
parent
0a3a2c3ebe
commit
20a9ca7875
jdk/test/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos
@ -36,6 +36,7 @@ import javax.swing.SwingUtilities;
|
||||
|
||||
import com.sun.swingset3.DemoProperties;
|
||||
import com.sun.swingset3.demos.JHyperlink;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -210,10 +211,10 @@ public final class ButtonDemo extends JPanel {
|
||||
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();
|
||||
|
@ -91,7 +91,6 @@ public class TabbedPaneDemo extends JPanel implements ActionListener {
|
||||
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();
|
||||
|
@ -31,6 +31,7 @@ import javax.swing.border.LineBorder;
|
||||
|
||||
import com.sun.swingset3.DemoProperties;
|
||||
import com.sun.swingset3.demos.DemoUtilities;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
/**
|
||||
* @author aim
|
||||
@ -145,8 +146,8 @@ public final class WindowDemo extends JPanel {
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user