Results 1 to 6 of 6
  1. #1
    Manfizy's Avatar
    Manfizy is offline Senior Member
    Join Date
    Nov 2008
    Location
    Germany
    Posts
    193
    Rep Power
    6

    Post How do i create a help file in java for the users of my application

    Hi pple,
    I just completed my first application but the only thing remaining is to create a help file. Any one with an idea on where i should start??

    Your replies will be highly appreciated:)
    We Learn Through Mistakes..,
    Manfizy:rolleyes:

  2. #2
    pellebye is offline Member
    Join Date
    Apr 2009
    Posts
    54
    Rep Power
    0

    Default

    Try this link

    devshed.com/c/a/Java/Java-Help-Files/]Java[/url] Help Files

    or do a googlesearch on "help file java".
    -
    Life is not the worst thing we have ... in a few minutes my coffee is ready.

  3. #3
    pellebye is offline Member
    Join Date
    Apr 2009
    Posts
    54
    Rep Power
    0

    Default

    Once more:

    Try this link

    Java Help Files

    or do a googlesearch on "help file java". :)
    -
    Life is not the worst thing we have ... in a few minutes my coffee is ready.

  4. #4
    Manfizy's Avatar
    Manfizy is offline Senior Member
    Join Date
    Nov 2008
    Location
    Germany
    Posts
    193
    Rep Power
    6

    Post

    Thank you so much for the link
    I checked it out and now am just playing around with the code. The only problem that am facing now is that i get an error
    invalid url
    How am i supposed to name html file according to this example??
    Must the help file be in html format or can i still use a word document?

    Below is the code

    Java Code:
    import java.io.*;
    import javax.swing.event.*;
    import javax.swing.*;
    import java.net.*;
    import java.awt.event.*;
    import java.awt.*;
    
    /**
     *
     * @author Manfizy
     */
    public class HelpWindow extends JFrame implements ActionListener {
        private final int WIDTH = 600;
        private final int HEIGHT = 400;
        private JEditorPane editorpane;
        private URL helpURL;
    //////////////////////////////////////////////////
    /**
      * HelpWindow constructor
      * @param String and URL
      */
    public HelpWindow(String title, URL hlpURL) {
       super(title);
       helpURL = hlpURL;
       editorpane = new JEditorPane();
       editorpane.setEditable(false);
       try {
            editorpane.setPage(helpURL);
        } catch (Exception ex) {
        ex.printStackTrace();
      }
      //anonymous inner listener
      editorpane.addHyperlinkListener(new HyperlinkListener() {
      public void hyperlinkUpdate(HyperlinkEvent ev) {
        try {
              if (ev.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                      editorpane.setPage(ev.getURL());
                     }
                  } catch (IOException ex) {
                      //put message in window
                      ex.printStackTrace();
                  }
              }
          });
         getContentPane().add(new JScrollPane(editorpane));
         addButtons();
        // no need for listener just dispose
         setDefaultCloseOperation(DISPOSE_ON_CLOSE);
        // dynamically set location
        calculateLocation();
        setVisible(true);
        // end constructor
      }
    /**
     * An Actionlistener so must implement this method
     *
     */
    public void actionPerformed(ActionEvent e) {
        String strAction = e.getActionCommand();
        URL tempURL;
        try {
           if (strAction == "Contents") {
                tempURL = editorpane.getPage();
                editorpane.setPage(helpURL);
            }
            if (strAction == "Close") {
             // more portable if delegated
               processWindowEvent(new WindowEvent(this,
                WindowEvent.WINDOW_CLOSING));
            }
        } catch (IOException ex) {
            ex.printStackTrace();
       }
    }
    /**
    : * add buttons at the south
      */
     private void addButtons() {
         JButton btncontents = new JButton("Contents");
         btncontents.addActionListener(this);
         JButton btnclose = new JButton("Close");
         btnclose.addActionListener(this);
         //put into JPanel
         JPanel panebuttons = new JPanel();
         panebuttons.add(btncontents);
         panebuttons.add(btnclose);
         //add panel south
         getContentPane().add(panebuttons, BorderLayout.SOUTH);
     }
     /**
       * locate in middle of screen
       */
      private void calculateLocation() {
         Dimension screendim = Toolkit.getDefaultToolkit().getScreenSize();
         setSize(new Dimension(WIDTH, HEIGHT));
         int locationx = (screendim.width - WIDTH) / 2;
         int locationy = (screendim.height - HEIGHT) / 2;
         setLocation(locationx, locationy);
    }
    public static void main(String [] args){
        URL index = ClassLoader.getSystemResource("index.html");
        new HelpWindow("Test", index);
    }
    //end HelpWindow class
    }
    cheerz!!
    We Learn Through Mistakes..,
    Manfizy:rolleyes:

  5. #5
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Better read the article java.sun.com/developer/technicalArticles/J2SE/Desktop/javahelp/

  6. #6
    Manfizy's Avatar
    Manfizy is offline Senior Member
    Join Date
    Nov 2008
    Location
    Germany
    Posts
    193
    Rep Power
    6

    Post

    Can somebody check out how am reading the url in the above code. everytime i try to compile i get an error
    java.io.IOException: invalid url
    Anyone with an idea??

    cheerz!
    We Learn Through Mistakes..,
    Manfizy:rolleyes:

Similar Threads

  1. How to create Setup for java application
    By kiki2009 in forum New To Java
    Replies: 21
    Last Post: 11-08-2009, 07:06 PM
  2. java,jsp code to create a website statistics application
    By g.shashikala in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 08-15-2009, 05:00 PM
  3. hiding source file from users
    By AXH in forum Java Applets
    Replies: 2
    Last Post: 10-28-2008, 10:43 AM
  4. Replies: 1
    Last Post: 10-21-2008, 01:16 PM
  5. Replies: 4
    Last Post: 09-14-2008, 05:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •