Using Field-Level Context-Sensitive Help

You can take context-sensitivity one step further and implement field-level help (sometimes called What’s This? help). In this scheme, the user clicks a button or selects a menu item that causes the mouse pointer to change—perhaps to a question mark. The user then clicks a control, such as a button or selection box, and the application displays online help specific to that control.

The TypeFacer application consists of buttons, boxes, and text-display areas, all of which are potential targets for field-level help. For example, a user might not know what the Show button does—a situation perfect for using field-level help. Figure 7.7 shows the help system after a user accesses field-level help for the Show button.

Field-level help

Figure 7-7. Field-level help

Programming Field-Level Context-Sensitive Help

Field-level context-sensitive help works like screen-level context-sensitive help. You use the same setHelpIDString( ) method as for screen-level help. Using this method, you provide a map ID for every component in the application, not just its usage modes or screens.

Use the following steps to add field-level context-sensitive help to the TypeFacer application. For this revision of the program, all the lines to be uncommented start with //#4.

  1. Associate a help topic with each user-interface component:

    // assign map IDs for field-level context-sensitive help CSH.setHelpIDString(inputField, ...

Get Creating Effective JavaHelp now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.