您的位置:首页 > 编程语言 > Java开发

java.awt.Desktop 简介

2015-11-10 16:23 393 查看
摘自api

The 
Desktop
 class
allows a Java application to launch associated applications registered on the native desktop to handle a 
URI
 or
a file.

//使用系统中的关联应用程序来打开特定的文件(或者URI)

Supported operations include://支持的操作包括
launching the user-default browser to show a specified URI; //使用默认浏览器打开URI
launching the user-default mail client with an optional 
mailto
 URI;//使用默认邮件客户端打开任意的mailto地址(optional:任意的)
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.

//假如没有关联的应用程序或者不能打开关联应用程序,会抛出exception

An application is registered to a URI or file type; for example, the 
"sxi"
 file extension is typically registered to StarOffice. 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. //调用的应用程序会运行在在java应该程序所运行的系统之上

ps:URL是一种具体的URI
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: