Class HeadlessException
- All Implemented Interfaces:
Serializable
public class HeadlessException extends UnsupportedOperationException
GraphicsEnvironment.isHeadless() method and throw HeadlessException if the latter returns true.- Since:
- 1.4
- See Also:
Constructor Summary
| Constructor | Description |
|---|---|
HeadlessException() |
Constructs a new HeadlessException with null as its detail message. |
HeadlessException |
Create a new instance with the specified detailed error message. |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
String |
getMessage() |
Returns the detail message string of this HeadlessException. |
Methods declared in class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Constructor Details
HeadlessException
public HeadlessException()
HeadlessException with null as its detail message. The default headless message may replace null in some cases, as outlined below. For such HeadlessException the default headless error message may be auto-generated for some platforms. The text of the default headless message may depend on whether the GraphicsEnvironment is in fact headless. That is, the default headless message is both system and environmentally dependent.
HeadlessException
public HeadlessException(String msg)
- Parameters:
-
msg- the error message
Method Details
getMessage
public String getMessage()
HeadlessException. Depending on the platform the message specified in the constructor may be followed by the default headless error message. The text of the default headless message may depend on whether the GraphicsEnvironment is in fact headless. That is, the default headless message is both system and environmentally dependent.- Overrides:
-
getMessagein classThrowable - Returns:
- the detail message string of this
HeadlessExceptioninstance (which may benull).
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/25/docs/api/java.desktop/java/awt/HeadlessException.html