Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help System.  RSS feed

 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to create a help system.I design it like this,just like windows help,a JTree on the left, the content on the right,when some node pressed the relative content appear.Maybe there are a toolbar and a menubar in the North.But to creat a search engine and an index is something complicated.Can anyone advise me something have been made well.I just use it to satisfy my requirments.If there isn't such a module,maybe you can give me advice on how to do it smartly.

Thanks!
 
Kai Witte
Ranch Hand
Posts: 356
 
Stefan Willi
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi letter french!

Maybe AurigaDoc would be usefull for you. It can creates JavaHelp, Pdf, Html...

But, be carefull with my recommendation! I've never used this tool...

stefan
 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've downloaded JavaHelp2.0.
It seems a nightmare to me.I've read the UserGuide.pdf.But still know it little.Should I read it again?It's all I have.
 
Kai Witte
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

I used JavaHelp a lot. For the old version of JavaHelp there was a book. The most important part of the book, how to create the files, is a free sample chapter. It still works for the new JavaHelp. I wrote something about that here.

A few years ago I wrote a program called html-form. The design of this program is flawed, but you can have a look at the source code to see how to integrate the help system into your software after you created the necessary non-Java-files based on the free sample chapter.

Conan
[ May 20, 2005: Message edited by: Conan Elvitaro ]
 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now another question come up.
I write an example using JavaHelp.It runs well in the Win Console(CMD).When I run it in the JBuilderX,some exceptions appear:
javax.help.HelpSetException: Could not parse
Got an IOException (null)
Parsing failed for null
I do config the jh.jar in the project required libraries.I've searched in google,someone said JBuilder integrated JavaHelp1.3,maybe the version confilced.But I can't find such a jar in the JBuilder.What's the problem after all?How to resolve it?
Thanks.
 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More detail.Bellow is my code:

package mytest;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.help.*;
import java.net.*;
import java.io.File;

public class HelloHelp {
public static String home = "user.dir";
//cfg file name
public static String hs = System.getProperty(home) +
File.separator + "cfg" +
File.separator + "hello.hs";

public static void main(String args[]) {
JFrame frame = new JFrame("Hello, JavaHelp");
frame.setDefaultCloseOperation(
JFrame.EXIT_ON_CLOSE);
Container content = frame.getContentPane();

JMenuBar menubar = new JMenuBar();
JMenu helpMenu = new JMenu("Help");
JMenuItem overview = new JMenuItem("Overview");
JMenuItem specific = new JMenuItem("Specific");
helpMenu.add(overview);
helpMenu.add(specific);
menubar.add(helpMenu);
frame.setJMenuBar(menubar);

JButton button1 = new JButton("The Button");
JButton button2 = new JButton("Context");

content.add(button1, BorderLayout.NORTH);
content.add(button2, BorderLayout.SOUTH);

HelpSet helpset = null;
ClassLoader loader = null;

URL url = HelpSet.findHelpSet(loader, hs);
try {
helpset = new HelpSet(loader, url);
}
catch (HelpSetException e) {
e.printStackTrace();
//System.err.println("Error loading");
return;
}

HelpBroker helpbroker = helpset.createHelpBroker();

ActionListener listener =
new CSH.DisplayHelpFromSource(helpbroker);
overview.addActionListener(listener);

CSH.setHelpIDString(specific, "one");
specific.addActionListener(listener);

CSH.setHelpIDString(button1, "two");
ActionListener tracker =
new CSH.DisplayHelpAfterTracking(helpbroker);
button2.addActionListener(tracker);

JRootPane rootpane = frame.getRootPane();
helpbroker.enableHelpKey(rootpane, "three", helpset);

frame.setSize(200, 200);
frame.show();
}
}

When I debug, I found URL url = HelpSet.findHelpSet(loader, hs); url is null.Why?
 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is I don't get the URL,so I use another method to get the URL.Everything is ok.
When I interate it in my project,another problem appear,I have to click a menuitem twice the help pop out.Below is my cold:

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.help.*;
import java.net.*;
import java.io.File;

public class HelpFrame {
public HelpFrame (JFrame frame, JMenuItem menuItem) {
HelpSet helpset = null;
ClassLoader loader = null;
String home = "user.dir";
String hs = System.getProperty(home) + File.separator + "cfg" +
File.separator + "IBRViewHelp" +
File.separator + "IBRViewHelp.hs";

try {
helpset = new HelpSet(loader, (new File(hs)).toURL());
}
catch (Exception e) {
e.printStackTrace();
return;
}

HelpBroker helpbroker = helpset.createHelpBroker();

ActionListener listener =
new CSH.DisplayHelpFromSource(helpbroker);
menuItem.addActionListener(listener);
JRootPane rootpane = frame.getRootPane();
helpbroker.enableHelpKey(rootpane, "overview", helpset);
}

}

//the menuitem actionPerformed method
public void actionPerformed(ActionEvent e ) {
new HelpFrame(this, menuitem);//this----a JFrame
}

Thanks.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!