JDialog and JWindow constructors (no-argument constructors or when passing null as argument) throw IllegalArgumentException instead of HeadlessException in headless mode. This is reproducible from b50 onwards on all platforms.
Stack trace:
Exception in thread "main" java.lang.IllegalArgumentException: headless environment
at java.awt.Window.init(Window.java:304)
at java.awt.Window.<init>(Window.java:299)
at java.awt.Window.<init>(Window.java:425)
at java.awt.Dialog.<init>(Dialog.java:642)
at java.awt.Dialog.<init>(Dialog.java:392)
at javax.swing.JDialog.<init>(JDialog.java:220)
at javax.swing.JDialog.<init>(JDialog.java:167)
at javax.swing.JDialog.<init>(JDialog.java:140)