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
@ -36,6 +36,7 @@ import javax.swing.SwingUtilities;
|
|||||||
|
|
||||||
import com.sun.swingset3.DemoProperties;
|
import com.sun.swingset3.DemoProperties;
|
||||||
import com.sun.swingset3.demos.JHyperlink;
|
import com.sun.swingset3.demos.JHyperlink;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -210,10 +211,10 @@ public final class ButtonDemo extends JPanel {
|
|||||||
return panel;
|
return panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) throws InterruptedException, InvocationTargetException {
|
||||||
final ButtonDemo buttonDemo = new ButtonDemo();
|
final ButtonDemo buttonDemo = new ButtonDemo();
|
||||||
|
|
||||||
javax.swing.SwingUtilities.invokeLater(() -> {
|
javax.swing.SwingUtilities.invokeAndWait(() -> {
|
||||||
JFrame frame = new JFrame(DEMO_TITLE);
|
JFrame frame = new JFrame(DEMO_TITLE);
|
||||||
frame.add(buttonDemo);
|
frame.add(buttonDemo);
|
||||||
frame.pack();
|
frame.pack();
|
||||||
|
@ -91,7 +91,6 @@ public class TabbedPaneDemo extends JPanel implements ActionListener {
|
|||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
JFrame frame = new JFrame(DEMO_TITLE);
|
JFrame frame = new JFrame(DEMO_TITLE);
|
||||||
|
|
||||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
||||||
frame.getContentPane().add(new TabbedPaneDemo());
|
frame.getContentPane().add(new TabbedPaneDemo());
|
||||||
frame.setPreferredSize(new Dimension(800, 600));
|
frame.setPreferredSize(new Dimension(800, 600));
|
||||||
frame.pack();
|
frame.pack();
|
||||||
|
@ -31,6 +31,7 @@ import javax.swing.border.LineBorder;
|
|||||||
|
|
||||||
import com.sun.swingset3.DemoProperties;
|
import com.sun.swingset3.DemoProperties;
|
||||||
import com.sun.swingset3.demos.DemoUtilities;
|
import com.sun.swingset3.demos.DemoUtilities;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author aim
|
* @author aim
|
||||||
@ -145,8 +146,8 @@ public final class WindowDemo extends JPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) throws InterruptedException, InvocationTargetException {
|
||||||
EventQueue.invokeLater(() -> {
|
EventQueue.invokeAndWait(() -> {
|
||||||
JFrame frame = new JFrame();
|
JFrame frame = new JFrame();
|
||||||
WindowDemo demo = new WindowDemo();
|
WindowDemo demo = new WindowDemo();
|
||||||
frame.add(demo);
|
frame.add(demo);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user