File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Help Docs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Help Docs" Watch "Help Docs" New topic
Author

Help Docs

Jason Boutwell
Ranch Hand

Joined: Apr 02, 2002
Posts: 40
Can I get some opinions as to the best way to go for presenting the documentation (User Guide and Javadocs) from the GUI?
I see that JEditorPane with HyperlinkListener is a popular choice in some older posts.
I see that some folks have used plain JFrames and JPanels.
Others chose not to have a help menu at all.
I don't want to get too elaborate with it.
What is the (best) (easiest) (full score) way?
Thanks in advance!
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

I had a JFrame with a JScrollPane, and put HTML file in it to display. Piece of cake.
As far as the JavaDoc, they were completely seperate, not in the GUI. I got 20/20 on Docs.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Robin Underwood
Ranch Hand

Joined: May 01, 2002
Posts: 117
Mark,
Thanks for the info. I tried your suggestion and the HTML page came up just fine, but the hyperlinks are ignored. Do you know if we need to use the JEditorPane if we have links?
Thanks in advance!
Jason Boutwell
Ranch Hand

Joined: Apr 02, 2002
Posts: 40
I must be missing something.
I have a separate JFrame for Docs, but when I try to launch it with pack() or setVisible(), my program hangs.
I have a MenuItem that I click, and the listener code launches the docs JFrame.
The Swing tutorial tells me nothing about launching a frame from witin a frame.
Any suggestions?
Thanks.
Robin Underwood
Ranch Hand

Joined: May 01, 2002
Posts: 117
Here is what I have so far that works OK except for the hyperlinks. I created a new dialog off the frame. Maybe there's a problem getting to your URL:
private void getHelp(String fileName) {
JTextPane pane = new JTextPane();
JScrollPane scroller = new JScrollPane();
scroller.getViewport().add(pane);
JDialog dialog = new JDialog(this, "Help", false);
dialog.getContentPane().add(scroller);
dialog.pack();
dialog.setSize(800,500);
dialog.setVisible(true);

try {
java.net.URL url = new java.net.URL("file:///" + System.getProperty("user.dir") + "/" + fileName);
pane.setPage(url);
}
catch (Exception e) {
e.printStackTrace();
}
}
Robin Underwood
Ranch Hand

Joined: May 01, 2002
Posts: 117
FYI...was able to get it to follow hyperlinks by using JEditorPane and HyperlinkListener.
Jason Boutwell
Ranch Hand

Joined: Apr 02, 2002
Posts: 40
Yeah. Looks like I needed to use JDialog, as opposed to JFrame.
Thanks alot.
Amit Kr Kumar
Ranch Hand

Joined: Feb 08, 2002
Posts: 100
Hi All
What should this Html Help File contain e.g Introduction, how to search and book etc or something else ?
In my case i have given link in this file (onlinehelp.html) to README.txt also. However README.txt is not a part of client.jar. Its a part of submission.jar. Thus in order to get the correct path i have to put onlinehelp.html also outside the jar ?
Is it correct ?
Is there any way i can give a link in html file at client .jar to the file lying outside client.jar ???
Amit
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Yeah, I just had one single page for each User documentation, one for Client GUI, and one for Server GUI, so I never had to see if hyperlinks worked.
Mark
Amit Kr Kumar
Ranch Hand

Joined: Feb 08, 2002
Posts: 100
Hi Mark
Does it mean that UserGUIGuide ie onlinehelp.html should be independent and should not contain the links to README.txt and apidocs/index.html.
In this case it can become a part of client.jar and there is no need to put it outside the client.jar
Amit
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

You don't have too put the Readme or the Javadocs in the GUI, if you don't want to. I didn't.
In this case it can become a part of client.jar and there is no need to put it outside the client.jar

If you are referring to the Readme and the Javadocs, then no they wouldn't need to be in the client.jar.
Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help Docs
 
Similar Threads
XSLT help
Java Scheduler - Quartz API?
Ship it
Servlet Showing Internal Error 500 but not displaying the error message
class question