Working with Java Help 2
Classes that need to access the help file do the following:
import javax.help.*;
// set up fields
JButton btnHelp = new JButton("Help");
HelpSet hs;
HelpBroker hb;
// code in the main body of the class
hb = model.getHelpSetBroker(); // model is my shared utility class
if (hb!=null){
ActionListener helper = new CSH.DisplayHelpFromSource(hb);
/**
*
* Description - listener for Help button
*
*/
btnHelp.addActionListener(helper) ;
}
// configure function key F1, help button, help menu item
// CSH.setHelpIDString(CustomerPanel.this.getRootPane(), "topic14");
// configure for a menu system ITEM to access a help topic
// CSH.setHelpIDString(helpItem, "topic14");
CSH.setHelpIDString(btnHelp, "item14");