Following test
public class TestH {
public static void main(String[] args) {
new javax.swing.JButton();
}
}
throws HeadlessException with latest JDK7 in the headless (-Djava.awt.headless=true) mode:
Exception in thread "main" java.awt.HeadlessException
at sun.awt.HeadlessToolkit.createKeyboardFocusManagerPeer(HeadlessToolkit.java:184)
at java.awt.KeyboardFocusManager.initPeer(KeyboardFocusManager.java:454)
at java.awt.KeyboardFocusManager.<init>(KeyboardFocusManager.java:448)
at java.awt.DefaultKeyboardFocusManager.<init>(DefaultKeyboardFocusManager.java:64)
at java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager(KeyboardFocusManager.java:218)
at java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager(KeyboardFocusManager.java:209)
at javax.swing.UIManager.initialize(UIManager.java:1442)
at javax.swing.UIManager.maybeInitialize(UIManager.java:1421)
at javax.swing.UIManager.getUI(UIManager.java:1009)
at javax.swing.JButton.updateUI(JButton.java:146)
at javax.swing.AbstractButton.init(AbstractButton.java:2169)
at javax.swing.JButton.<init>(JButton.java:136)
at javax.swing.JButton.<init>(JButton.java:90)
at TestH.main(TestH.java:3)