Exception without exception in java

I heard that when we use the awt or swing, creating the FRAME, can be selected negative exception, which is the "exception to the Headless". I had no such exception. Can anyone tell when this exception is being thrown?

+4
source share
3 answers

HeadlessException class description

Throw when a code dependent on a keyboard, display, or mouse is called in an environment that does not support a keyboard, display, or mouse.

More details http://docs.oracle.com/javase/7/docs/api/java/awt/HeadlessException.html

+5
source

My 2 cents .. you can also set java.awt.headless = true / false, for example System.setProperty("java.awt.headless", "true"/"false");

+3
source

This exception occurs when we try to instantiate an awt or swing component from a system that does not have a terminal (head). This usually happens on a unix virtual system. You must install the xbfb component and set the DISPLAY parameter before running the program.

0
source

All Articles