Skip to main content

How do I set cursor for field-level help?

2 replies [Last post]

I am trying to understand how the special cursor is set (and reset to normal) when the field level help is activated. I've been through the manual and the ApiDemo sample program but I can't figure out how this works.

I want to do what the IdeDemo is doing, namely set a different cursor when the field-level help button on the toolbar has been pressed, display the help for whatever item the cursor is on when I click the mouse, then make the cursor revert to its previous value after the help has been displayed.

I'm an experienced Java programmer but have never tried changing a cursor before.


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2006-02-17

Hi Henry,

The context sensitive help cursor is set/reset automatically using the CSH.DisplayHelpAfterTracking action listner, so really there is nothing to do.

Here is a code segment from a program which has a toolbar button (JButton) called csHelpButton for context sensitive help, and another toolbar button helpButton which displays the full help file.

url = HelpSet.findHelpSet(loader, HELPSETNAME);
helpSet = new HelpSet(loader, url);
helpBroker = helpSet.createHelpBroker("wfegui");
helpBroker.enableHelpKey(getRootPane(), "top", helpSet);
helpBroker.enableHelpOnButton(helpButton, "top", null);
helpBroker.enableHelpOnButton(contentsMenuItem, "top", null);
csHelpButton.addActionListener(new CSH.DisplayHelpAfterTracking(helpBroker));

/* set help-id on gui items */
setHelp(exitButton, "exitButton");
setHelp(copyButton, "copyButton");

I hope this helps


Many thanks, Brendan!!

I might have figured this out myself if the manual or the API mentioned that the change of the cursor behaviour took care of itself after you used the CSH.DisplayHelpAfterTracking() method. (Hint to developers of JavaHelp....)

My Help now works fine. Thanks again!