java.awt.Desktop 简介

摘自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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值