the method setDefaultCloseOperation has thrown an
IllegalArgumentException when it was feeded with illegal arguments,
which is nice but not what the reference implementation does. The right
behaviour is to accept illegal arguments as DO_NOTHING_ON_CLOSE.
I fixed this.
2005-05-13 Roman Kennke <[EMAIL PROTECTED]>
* javax/swing/JDialog.java
(setDefaultCloseOperation): Don't throw an IllegalArgumentException
but instead accept illegal values as DO_NOTHING_ON_CLOSE.
/Roman
Index: javax/swing/JDialog.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JDialog.java,v
retrieving revision 1.11
diff -u -r1.11 JDialog.java
--- javax/swing/JDialog.java 22 Oct 2004 12:43:59 -0000 1.11
+++ javax/swing/JDialog.java 13 May 2005 14:04:34 -0000
@@ -525,7 +525,9 @@
operation == DISPOSE_ON_CLOSE)
close_action = operation;
else
- throw new IllegalArgumentException("Default close operation must be one
of DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE");
+ // accept illegal value and set the property to the default value,
+ // that's what the reference implementation does
+ close_action = DO_NOTHING_ON_CLOSE;
}
/**
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches