This content has been marked as final. Show 4 replies
I have tried using enableHelpOnButton(MenuItem, String helpID, HelpSet hs) method. With this on clicking the menu the help opens, but I want the action to happen on pressing F1 on the menu item.
The method you specified is not avialable with the Java Help APIs that I am using.
I have tried the following too, even this does not give desired results.
helpBroker.enableHelp ( NEWMenuItem , "NEW" , helpSet ) ;
Please let me know if you get any solution.
It's a bug - I decided to respond since I've just had to solve the same problem and this was the thread that kept popping when I was searching for the solution ...
enableHelp(Component, String, HelpSet) should add an action listener to the component but it doesn't. Under the bonnet all it does is set the HelpID and HelpSet as client properties on the component.
To get round this you have to add the listener manually ...
hb.enableHelp(helpItem, "helpkey", helpSet)
and it will work in the same way as F1 and Buttons (which is where I worked this out).