我想知道是否有一种跨平台的方法可以从 Java Swing 应用程序内部模拟 Windows 打开方式对话框。我的应用程序是电子学习包的编辑器,其中一位用户希望能够在应用程序内用他们选择的编辑器打开内容文件,资源通常是 HTML 文件、图像、css、javascript,但可以是任何类型可以在浏览器中运行的内容。谢谢
最佳答案
我认为您可以使用 JDIC(Java 桌面集成组件)做一些事情。
https://jdic.dev.java.net/documentation/Examples.html
查看包 org.jdesktop.jdic.filetypes
Provides classes for associating applications with file types and accessing a registered file type association.
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 - 在 Java 中打开 WIth 对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1238991/