How to Handle the Headless Exception in Java
The java.awt.HeadlessException is a runtime exception in Java that occurs when code that is dependent on a keyboard, display or mouse is called in an environment that does not support a keyboard, display or mouse. Since HeadlessException is an unchecked exception, it does not need to be declared in the throws clause of a method or constructor.