JDialog has a number of constructors whith Dialog argument:
- public JDialog(Dialog owner)
- public JDialog(Dialog owner, boolean modal)
- public JDialog(Dialog owner, String title)
- public JDialog(Dialog owner, String title, boolean modal)
Also there is a description "owner - the non-null Dialog from which the dialog is displayed" in the spec according to owner. But there are no clear specification what should be if owner is null.
So in fact the test below may show some strange logic in JDialog constructor. If the test below is running on JDK 5 it throws an exception:
Exception in thread "main" java.lang.IllegalArgumentException: null owner window...
But on JDK 6 b42 it exits silently.
The test:
==
import javax.swing.JDialog;
import java.awt.Dialog;
public class Test {
public static void main(String[] args) {
JDialog dialog = new JDialog((Dialog)null);
}
}
==
###@###.### 2005-06-28 12:08:44 GMT