• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help Docs

 
Jason Boutwell
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Robin Underwood
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FYI...was able to get it to follow hyperlinks by using JEditorPane and HyperlinkListener.
 
Jason Boutwell
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah. Looks like I needed to use JDialog, as opposed to JFrame.
Thanks alot.
 
Amit Kr Kumar
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic