8169954: JFileChooser/8021253: java.lang.RuntimeException: Default button is not pressed
Reviewed-by: serb
This commit is contained in:
parent
7597cba92b
commit
cacce843aa
@ -768,7 +768,6 @@ javax/swing/text/JTextComponent/5074573/bug5074573.java 8196100 windows-all
|
|||||||
javax/swing/JFileChooser/6798062/bug6798062.java 8146446 windows-all
|
javax/swing/JFileChooser/6798062/bug6798062.java 8146446 windows-all
|
||||||
javax/swing/JComboBox/8182031/ComboPopupTest.java 8196465 linux-all,macosx-all
|
javax/swing/JComboBox/8182031/ComboPopupTest.java 8196465 linux-all,macosx-all
|
||||||
javax/swing/JFileChooser/6738668/bug6738668.java 8194946 generic-all
|
javax/swing/JFileChooser/6738668/bug6738668.java 8194946 generic-all
|
||||||
javax/swing/JFileChooser/8021253/bug8021253.java 8169954 windows-all,linux-all,macosx-all
|
|
||||||
javax/swing/JFileChooser/8062561/bug8062561.java 8196466 linux-all,macosx-all
|
javax/swing/JFileChooser/8062561/bug8062561.java 8196466 linux-all,macosx-all
|
||||||
javax/swing/JInternalFrame/Test6325652.java 8224977 macosx-all
|
javax/swing/JInternalFrame/Test6325652.java 8224977 macosx-all
|
||||||
javax/swing/JInternalFrame/8146321/JInternalFrameIconTest.java 8225045 linux-all
|
javax/swing/JInternalFrame/8146321/JInternalFrameIconTest.java 8225045 linux-all
|
||||||
|
@ -47,11 +47,12 @@ public class bug8021253 {
|
|||||||
private static volatile boolean defaultKeyPressed;
|
private static volatile boolean defaultKeyPressed;
|
||||||
private static JFileChooser fileChooser;
|
private static JFileChooser fileChooser;
|
||||||
private static File file;
|
private static File file;
|
||||||
|
private static JFrame frame;
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
try {
|
||||||
Robot robot = new Robot();
|
Robot robot = new Robot();
|
||||||
robot.setAutoDelay(50);
|
robot.setAutoDelay(100);
|
||||||
|
|
||||||
SwingUtilities.invokeAndWait(new Runnable() {
|
SwingUtilities.invokeAndWait(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -60,6 +61,7 @@ public class bug8021253 {
|
|||||||
});
|
});
|
||||||
|
|
||||||
robot.waitForIdle();
|
robot.waitForIdle();
|
||||||
|
robot.delay(1000);
|
||||||
|
|
||||||
SwingUtilities.invokeAndWait(new Runnable() {
|
SwingUtilities.invokeAndWait(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -76,13 +78,18 @@ public class bug8021253 {
|
|||||||
if (!defaultKeyPressed) {
|
if (!defaultKeyPressed) {
|
||||||
throw new RuntimeException("Default button is not pressed");
|
throw new RuntimeException("Default button is not pressed");
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
if (frame != null) {
|
||||||
|
SwingUtilities.invokeAndWait(frame::dispose);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void createAndShowGUI() {
|
private static void createAndShowGUI() {
|
||||||
|
|
||||||
file = getTempFile();
|
file = getTempFile();
|
||||||
|
|
||||||
final JFrame frame = new JFrame("Test");
|
frame = new JFrame("Test");
|
||||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
frame.setSize(200, 300);
|
frame.setSize(200, 300);
|
||||||
|
|
||||||
@ -97,6 +104,7 @@ public class bug8021253 {
|
|||||||
|
|
||||||
frame.getContentPane().add(BorderLayout.CENTER, fileChooser);
|
frame.getContentPane().add(BorderLayout.CENTER, fileChooser);
|
||||||
frame.setSize(fileChooser.getPreferredSize());
|
frame.setSize(fileChooser.getPreferredSize());
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user