简体   繁体   English

如何在Java Swing应用程序中打包和运行Windows帮助(.chm)文件

[英]How to package and run Windows Help (.chm) file in a Java Swing application

I'm making a Swing application that will only run on Windows and I want to package everything into a single .jar file. 我正在制作一个仅在Windows上运行的Swing应用程序,我想将所有内容打包到一个.jar文件中。 I want to include a .chm help file in the JAR and be able to launch it from clicking a JMenuItem marked "Help" or "Contents" (I already have a working understanding of creating AbstractAction subclasses). 我想在JAR中包含一个.chm帮助文件,并能够通过单击标记为“ Help”或“ Contents”的JMenuItem来启动该文件(我已经对创建AbstractAction子类有一定的了解)。 How can I programmatically open a .chm file from a JAR file? 如何以编程方式从JAR文件打开.chm文件?

Desktop provides an open() method. Desktop提供了一个open()方法。 You'll probably have to retrieve the .chm as an and park it at a known location in the file system. 您可能必须将.chm作为来检索,并将其停放在文件系统中的已知位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM