How can I access specific help for modal dialogs by pressing F1

So far I have loaded a helpset, created a helpbroker and I'm able to view context sensitive help for menu items and components in the main frame of my application.

I can also view help by adding the following line to my modal dialog:

mainFrame.helpBroker.enableHelpOnButton( helpbutton, "ID_String", null );

Using a key listener with my modal dialog I can also jump to the context specific help page.

But isn't there an elegant way to associate a help ID with the modal dialog and pressing F1 gives the specific page without the keylistener stuff?

I'd be a very happy camper if anyone could give me a hint.

Holger

[666 byte] By [hiobsun] at [2007-9-26 2:28:49]
# 1

Mea culpa! I should have looked up the JH users guide more carefully prior to posting the above.

Apparently, there is no elegant way to access CSH from a modal dialog. To my great disbelieve one has to catch the F1 or HelpButton event with a key listener added to the modal or nonmodal dialog. Similarily you could implement the KeyListener interface.

With the method keyReleased() you can display the helpbroker of your main frame with the desired ID.

So long Holger

hiobsun at 2007-6-29 9:45:06 > top of Java-index,Desktop,Developing for the Desktop...