-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
6
-
x86
-
windows_xp
FULL PRODUCT VERSION :
java version "1.6.0-rc"
Java(TM) SE Runtime Environment (build 1.6.0-rc-b104)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b104, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Window XP SP2
A DESCRIPTION OF THE PROBLEM :
I had a JDialog that had DISPOSE_ON_CLOSE as the defaultCloseOperation and it ran great for 5.0 however when I compiled with 6.0, I recieved the following exception :
[java] Exception in thread "main" java.lang.IllegalArgumentException: defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE
[java] at javax.swing.JDialog.setDefaultCloseOperation(JDialog.java:705)
So I changed the defaultCloseOperation to JDialog.DISPOSE_ON_CLOSE
defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE
javax.swing.JDialog.setDefaultCloseOperation(JDialog.java:705)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Compile correctly
ACTUAL -
Failure to compile
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.lang.IllegalArgumentException: defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE
at javax.swing.JDialog.setDefaultCloseOperation(JDialog.java:705)
at testing.Test.main(Test.java:16)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
public class Test {
public static void main(String[] args) {
JDialog jd;
JFrame frame = new JFrame();
jd = new JDialog(frame, "Test", true);
jd.setDefaultCloseOperation(JDialog.EXIT_ON_CLOSE);
}
}
---------- END SOURCE ----------
java version "1.6.0-rc"
Java(TM) SE Runtime Environment (build 1.6.0-rc-b104)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b104, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Window XP SP2
A DESCRIPTION OF THE PROBLEM :
I had a JDialog that had DISPOSE_ON_CLOSE as the defaultCloseOperation and it ran great for 5.0 however when I compiled with 6.0, I recieved the following exception :
[java] Exception in thread "main" java.lang.IllegalArgumentException: defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE
[java] at javax.swing.JDialog.setDefaultCloseOperation(JDialog.java:705)
So I changed the defaultCloseOperation to JDialog.DISPOSE_ON_CLOSE
defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE
javax.swing.JDialog.setDefaultCloseOperation(JDialog.java:705)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Compile correctly
ACTUAL -
Failure to compile
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.lang.IllegalArgumentException: defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE
at javax.swing.JDialog.setDefaultCloseOperation(JDialog.java:705)
at testing.Test.main(Test.java:16)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
public class Test {
public static void main(String[] args) {
JDialog jd;
JFrame frame = new JFrame();
jd = new JDialog(frame, "Test", true);
jd.setDefaultCloseOperation(JDialog.EXIT_ON_CLOSE);
}
}
---------- END SOURCE ----------
- duplicates
-
JDK-6403861 REGRESSION: JDialog.setDefaultCloseOperation regression
-
- Closed
-