Module java.desktop
Package java.awt

## Class HeadlessException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - java.lang.UnsupportedOperationException
        - - java.awt.HeadlessException

All Implemented Interfaces:
  Serializable

    public class HeadlessException
    extends UnsupportedOperationException

Thrown 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:
  1.4
See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`HeadlessException()` Constructs new `HeadlessException`
`HeadlessException(String msg)` Create a new instance with the specified detailed error message.

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `getMessage()` Returns the detail message string of this throwable.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

### Constructor Detail

#### HeadlessException

    public HeadlessException()

Constructs new `HeadlessException`

#### HeadlessException

    public HeadlessException(String msg)

Create a new instance with the specified detailed error message.

Parameters:
  `msg` - the error message

### Method Detail

#### getMessage

    public String getMessage()

Returns the detail message string of this throwable.

Overrides:
  `getMessage` in class `Throwable`
Returns:
  the detail message string of this `Throwable` instance (which may be `null`).