Module java.desktop
Package java.awt

Class Desktop

java.lang.Object
java.awt.Desktop

public class Desktop
extends Object
The Desktop class allows interact with various desktop capabilities.

Supported operations include:

  • launching the user-default browser to show a specified URI;
  • launching the user-default mail client with an optional mailto URI;
  • launching a registered application to open, edit or print a specified file.

This class provides methods corresponding to these operations. The methods look for the associated application registered on the current platform, and launch it to handle a URI or file. If there is no associated application or the associated application fails to be launched, an exception is thrown. Please see Desktop.Action for the full list of supported operations and capabilities.

An application is registered to a URI or file type. The mechanism of registering, accessing, and launching the associated application is platform-dependent.

Each operation is an action type represented by the Desktop.Action class.

Note: when some action is invoked and the associated application is executed, it will be executed on the same system as the one on which the Java application was launched.

Since:
1.6
See Also:
Desktop.Action