This discussion is archived
0 Replies Latest reply: Jul 16, 2009 5:52 AM by 843810 RSS

Activating Help using a JDesktopPane

843810 Newbie
Currently Being Moderated
Hi everyone

currently i habe a problem using the Java Help System. I got the following code:
public class MyFrame extends JFrame{
public MyFrame(){  
    JDesktopPane p = new JDesktopPane();
    this.getContentPane().add(p);
    HelpSet hs = null;
    String file = "helpfile.hs";
    ClassLoader cl = this.getClass().getClassLoader();
    try {
        URL hsURL = HelpSet.findHelpSet(cl, file);
        hs = new HelpSet(null, hsURL);
    }
    catch (Exception ee) {

        return;
    }
    if (hs != null) {
        HelpBroker hb = hs.createHelpBroker();

        hb.enableHelpKey(getRootPane(), hs.getHomeID().id, hs);

    }
  }
  setVisible(true);
}
When the Frame is displayed i pressed F1 without any effect. If i call:
  getContentPane().add(p);
the Help-Frame is displayed after pressing F1. To me it seems that there is a problem with JDesktopPane. Can anyone help me?