Open windows help file on button click in java application

This article will describe how to open a windows help file .chm file in a java application as a result of a button click or click on a menu item, along with example source code to achieve the result.

Add the following code to the actionperformed event of the button or the menu item.

File file = new File("c:\\program files\\myApp\\help.chm");
try
   {
         Runtime.getRuntime().exec("c:\\windows\\hh.exe " + file.getPath() ); //+ "::/TOPIC_ID.html");
   } catch (IOException e1)
   {
         e1.printStackTrace();
   }


That is all.

If you liked this article please do leave a reply and share it with friends.

Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.