用Java打开WIth对话框 [英] Open WIth dialog in Java

查看:75
本文介绍了用Java打开WIth对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否存在跨平台的方法来模仿Java Swing应用程序中的Windows Open With对话框.我的应用程序是用于学习软件包的编辑器,并且其中一个用户希望能够在应用程序中从他们选择的编辑器中打开内容文件,资源通常是HTML文件,图像,css,javascript,但可以是任何类型可以在浏览器中运行的内容.谢谢

I was wondering if there's a cross platform way to mimic the Windows Open With dialog from inside a Java Swing application. My application is an editor for elearning packages and one of the users wanted to be able to open the content files in the editor of their choice from within the application, resources are generally HTML files, images, css, javascript, but can be any type of content that can run in a browser. Thanks

推荐答案

我认为您可以使用JDIC(Java桌面集成组件)来做一些事情.

I think that you may be able to do something with JDIC (Java Desktop Integration Components).

https://jdic.dev.java.net/documentation/Examples.html

看看软件包 org.jdesktop.jdic.filetypes

https://jdic.dev.java.net/nonav/documentation/javadoc/jdic/org/jdesktop/jdic/filetypes/package-summary.html

提供用于关联的类具有文件类型和访问注册文件类型协会.

Provides classes for associating applications with file types and accessing a registered file type association.

每个桌面都允许用户查看与相关文件应用程序.通常是台式机使用允许用户的注册表将应用程序与文件关联类型.关联包括诸如MIME类型,文件之类的信息扩展和可能采取的措施应用于文件类型.通过访问关联信息桌面可以调用适当的应用程序处理文件,显示URL或发送电子邮件.

Every desktop allows the user to view files with the associated applications. Usually a desktop comes with a registry that allows the user to associate applications with file types. An association includes information like a MIME type, file extensions, and actions that could be applied to the file type. By accessing the association information, the desktop could invoke the appropriate applications to handle a file, display an URL or send an email.

这篇关于用Java打开WIth对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆