Index: javax/swing/JFrame.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JFrame.java,v
retrieving revision 1.23
diff -u -r1.23 JFrame.java
--- javax/swing/JFrame.java 17 Jun 2005 11:53:50 -0000 1.23
+++ javax/swing/JFrame.java 20 Jun 2005 15:26:53 -0000
@@ -331,8 +331,7 @@
* When EXIT_ON_CLOSE
is specified this method calls
* SecurityManager.checkExit(0)
which might throw a
* SecurityException
. When the specified operation is
- * not one of the above a IllegalArgumentException
is
- * thrown.
+ * not one of the above use default HIDE_ON_CLOSE.
*/
public void setDefaultCloseOperation(int operation)
{
@@ -342,8 +341,8 @@
if (operation != EXIT_ON_CLOSE && operation != DISPOSE_ON_CLOSE
&& operation != HIDE_ON_CLOSE && operation != DO_NOTHING_ON_CLOSE)
- throw new IllegalArgumentException("operation = " + operation);
-
- close_action = operation;
+ close_action = HIDE_ON_CLOSE;
+ else
+ close_action = operation;
}
}
Index: javax/swing/JInternalFrame.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JInternalFrame.java,v
retrieving revision 1.17
diff -u -r1.17 JInternalFrame.java
--- javax/swing/JInternalFrame.java 17 Jun 2005 11:53:50 -0000 1.17
+++ javax/swing/JInternalFrame.java 20 Jun 2005 15:26:53 -0000
@@ -1297,19 +1297,20 @@
/**
* This method sets the action taken when this JInternalFrame is closed.
+ * Defaults to DISPOSE_ON_CLOSE if operation is not a legal value.
*
* @param operation One of DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE or
* DISPOSE_ON_CLOSE.
*
- * @throws Error If the given operation is not one of the allowed modes.
*/
public void setDefaultCloseOperation(int operation)
{
if (operation != DO_NOTHING_ON_CLOSE
&& operation != HIDE_ON_CLOSE
&& operation != DISPOSE_ON_CLOSE)
- throw new Error("Close operation must be one of DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE");
- defaultCloseOperation = operation;
+ defaultCloseOperation = DISPOSE_ON_CLOSE;
+ else
+ defaultCloseOperation = operation;
}
/**