• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Putting user Help file on GUI

 
Henry Le
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I tried to display user help "userguild.html" on the GUI, sothat users can see it when clicking the Help menu. I used JTextPane component to render the HTML. I put the userguild.html in the same folder of the client GUI. When I run the program under different directory, for example in C:\, the program looks for the file in the current directory, and there is no such file as C:\userguild.html for the program to find and display. Please give me some ideas on how to get around with this....

I did something like this:

...JTextPane pane = new JTextPane();
..String userDoc = "userguild.html";
..
java.net.URL url = new java.net.URL("file:" + userDoc);
pane.setPage(url);


Thank you very much...
 
Chulwoo Choi
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You can consider using classpath.
For example, put userguide.html in suncertify/ui directory, in which UI class files (not Java source files) would reside. Then, in your code, replace

with

Then, it will work.

Regards,
Chulwoo
 
Mike Ngo
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add a text field at the top of the help window so that the user can enter the URL of the user guide.
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that's the worst possible option.
How would the user know where to find the userguide except from the userguide?
You should NEVER require effort for users to get to the online help and documentation.
I've provided a toolbar button, a menu item, AND a keyboard shortcut to it, and was considering adding a context menu item as well. Decided against the latter as it's IMO a bit overdone.
 
Mike Ngo
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that's the worst possible option.
How would the user know where to find the userguide except from the userguide?

Look at your web browser. How people find out about javaranch or other sites, dude? What if the help doc is hosted by a web server?
 
Petr Hejl
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at your web browser. Is it necessary to guess _any_ address when you click Help->Help Contents (in FF)?
 
Mike Ngo
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at your web browser. Is it necessary to guess _any_ address when you click Help->Help Contents (in FF)?


Well, you are assuming that the help doc is installed WITH the application.
My (html) user guide is external to the application and can be hosted by a web server. I have a help browser that the user can optionally view the help from within the app.
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
still a bad choice.
I'd subtract points for it were I an assessor, and might cause it to be an automatic failure depending on the exact wording of the requirements document.
 
Mike Ngo
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
still a bad choice.
I'd subtract points for it were I an assessor, and might cause it to be an automatic failure depending on the exact wording of the requirements document.


Luckily you were not!
 
Sam Codean
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
even i would have subtracted the points if i were to be the evaluator
 
Petr Hejl
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to make help accessible _from_ your application you should make it _part_ of your application (jar). The separate file is not required if the help is placed in the application. So there is no reason to place it somewhere outside. If you really really want to have it accessible outside, just place a copy outside of the jar. It is not so clear, but much more user friendly (compared to user entered location of help file - really confusing "user who need help have to enter location of some file?").
 
Henry Le
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all for interesting discussion. I am so glad. It works now with classpath.
Thanks!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic