This discussion is archived
2 Replies Latest reply: Aug 12, 2008 8:31 AM by 843810 RSS

Help Needed with JavaHelp

843810 Newbie
Currently Being Moderated
I'm trying to implement a Help using JavaHelp. The function I use is the following one:
 private void ayuda()
        // Find the HelpSet file and create the HelpSet object
        String helpHS = "help.hs";
        ClassLoader cl = this.getClass().getClassLoader();
        try {
          URL hsURL = HelpSet.findHelpSet(cl,helpHS);          
          HelpSet hs = new HelpSet(cl, hsURL);
          // Create a HelpBroker object:
          HelpBroker hb = hs.createHelpBroker();
          myMenuItem.addActionListener(new CSH.DisplayHelpFromSource( hb ));
          hb.enableHelpOnButton(myMenuItem,"administrator", hs);   
        } catch (Exception ee) {
       // Say what the exception really is
        System.out.println( "HelpSet " + ee.getMessage());

I'm using NetBeans6.0. I've included to the proyect the toc.xml, help.hs, and hMap.jhm. I've tried everything I could think about... Just can't imagine why it's failing.

I've also tried without including them && writing the absolute path in the String helpHS.

Got the error printed. It says: "HelpSet Null "

Please, i need help, i'm completelly desperated... If you need more information,let me know, but please, try to help me, I'm completelly stuck.

Edited by: pipiloptical on Jun 30, 2008 4:48 PM
  • 1. Re: Help Needed with JavaHelp
    843810 Newbie
    Currently Being Moderated
    I puzzled this out a while back myself. Here's an example from a working setup. Two things stand out - first, the name of the help set is case-sensitive. Second, you need to get the class path right. In this example the help set was included in the project as a library jar.

         // load help system
         String hs_name = "tertooctree.hs";// !! CASE SENSITIVE!!
         ClassLoader cl = this.getClass().getClassLoader();
             URL hsURL = HelpSet.findHelpSet(cl, hs_name);
             m_HS = new HelpSet(null, hsURL);
             m_HB = m_HS.createHelpBroker();
             m_mnuHelpContents.addActionListener(new CSH.DisplayHelpFromSource(m_HB));
         catch (Exception e)
  • 2. Re: Help Needed with JavaHelp
    843810 Newbie
    Currently Being Moderated
    Is this still a problem or did you get it resolved?