Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

Java HelpSet

Thread view: 
Jamie - 23 Mar 2006 13:17 GMT
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
Rhino - 24 Mar 2006 01:55 GMT
> Hi All,
>
[quoted text clipped - 13 lines]
>
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.