 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jamie Guest
|
Posted: Thu Mar 23, 2006 1:12 pm Post subject: Java HelpSet |
|
|
Hi All,
I am just trying to find out how to use Java Help and have come across a
problem at the first step.
I have the line below which I thought should find the help set file. For
some reason it always returns null.
ClassLoader cl = getClass().getClassLoader();
hsURL=HelpSet.findHelpSet(cl, "Help/javahelpexample.hs");
The Help folder is in my application directory so it should be able to find
the file fine I thought.
P.S. cl is not null.
Any suggestions?
Regards
Jamie |
|
| Back to top |
|
 |
Rhino Guest
|
Posted: Fri Mar 24, 2006 1:12 am Post subject: Re: Java HelpSet |
|
|
"Jamie" <jamie (AT) jamieallison (DOT) co.uk> wrote in message
news:UKadnQC__J8yDL_ZRVnysA (AT) bt (DOT) com...
| Quote: | Hi All,
I am just trying to find out how to use Java Help and have come across a
problem at the first step.
I have the line below which I thought should find the help set file. For
some reason it always returns null.
ClassLoader cl = getClass().getClassLoader();
hsURL=HelpSet.findHelpSet(cl, "Help/javahelpexample.hs");
The Help folder is in my application directory so it should be able to
find the file fine I thought.
P.S. cl is not null.
Any suggestions?
I the JavaHelp User's Guide quite helpful when I was getting started with |
JavaHelp; you can download it at:
http://java.sun.com/products/javahelp/download_binary.html#userguide. That
page also contains instructions for subscribing to the JavaHelp mailing
list, which is supported by one of the developers of the JavaHelp software.
That means you get get help from one of the guys who wrote the product; you
can't ask for much better than that.
There is also a JavaHelp forum at
http://forums.java.net/jive/category.jspa?categoryID=53. You may have to
sign up for Java Developer Connection before you can post to it; I can't
remember for sure. But I think you can look at the current posts without
signing up. A search of that forum may get you the answer to your question.
For what it's worth, here is a method that I use to set up help in one of my
programs; I _think_ it worked the last time I ran the program:
private void setupHelp() {
String METHOD_NAME = "setupHelp()";
/* Find the HelpSet file and create the HelpSet object. */
ClassLoader classLoader = this.getClass().getClassLoader();
HelpSet helpSet = null;
try {
URL helpSetUrl = HelpSet.findHelpSet(classLoader, SDAC_HELPSET_NAME);
helpSet = new HelpSet(null, helpSetUrl);
}
catch (HelpSetException hs_excp) {
Object[] msgArgs = {"\n", SDAC_HELPSET_NAME, moreInLog};
String msg = utilities.logMessage(Level.SEVERE, CLASS_NAME, METHOD_NAME,
"msg009",
msgArgs, hs_excp);
JOptionPane.showMessageDialog(this, msg, CLASS_NAME,
JOptionPane.ERROR_MESSAGE);
return;
}
/* Create a HelpBroker object: */
helpBroker = helpSet.createHelpBroker();
/* Connect the Documentation item to the help broker. */
documentationItem.addActionListener(new
CSH.DisplayHelpFromSource(helpBroker));
/* Enable window-level help on RootPane. */
JRootPane rootpane = this.getRootPane();
helpBroker.enableHelpKey(rootpane, "events.editor", null);
/* Activate context-sensitive help button on toolbar. */
fieldHelpButton.addActionListener(new
CSH.DisplayHelpAfterTracking(helpBroker));
/* Set up field-level help for individual components. */
CSH.setHelpIDString(tableView, "eventeditor.table");
CSH.setHelpIDString(htmlSource, "eventeditor.htmlSource");
CSH.setHelpIDString(formattedHtml, "eventeditor.formattedHtml");
CSH.setHelpIDString(reformatButton, "eventeditor.reformatButton");
CSH.setHelpIDString(updateButton, "eventeditor.updateButton");
CSH.setHelpIDString(exitButton, "eventeditor.exitButton");
}
--
Rhino |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|