Text in JEditorPane with links to actions

Discussion in 'Java' started by HawkLane, Dec 15, 2012.

  1. HawkLane

    HawkLane Guest

    My boss wants us to have like a help document in a Swing application.
    This means that if the user clicks on a special term (underlined), the
    "help text" (explanation of the term) is shown, whether in a pop-up window
    or something else. Is the best way to do this using a HyperlinkListener or
    something else?
    HawkLane, Dec 15, 2012
    #1
    1. Advertising

  2. HawkLane

    markspace Guest

    On 12/15/2012 11:02 AM, HawkLane wrote:
    >
    > My boss wants us to have like a help document in a Swing application.
    > This means that if the user clicks on a special term (underlined), the
    > "help text" (explanation of the term) is shown, whether in a pop-up
    > window or something else. Is the best way to do this using a
    > HyperlinkListener or something else?
    >


    I see JavaFx links are being added to the Java tutorial, by Oracle. I
    think you'd be remiss to not think about JavaFX. Here's the link from
    the tutorial:

    <http://docs.oracle.com/javafx/2/ui_controls/editor.htm>

    However my personal experience is "I dunno." In general you do use
    HyperlinkListener to implement links with a JEditorPane. Whether that's
    a good idea for "help text" is beyond my ken.

    You should probably also have a look at JavaHelp if you stick to Swing.
    However I've seen some people claim it's too complicated for what it
    does. Rolling your own help in Java seems a popular option.

    <http://javahelp.java.net/>
    markspace, Dec 15, 2012
    #2
    1. Advertising

  3. HawkLane

    Roedy Green Guest

    On 15 Dec 2012 19:02:45 GMT, (HawkLane) wrote, quoted
    or indirectly quoted someone who said :

    > My boss wants us to have like a help document in a Swing application.
    >This means that if the user clicks on a special term (underlined), the
    >"help text" (explanation of the term) is shown, whether in a pop-up window
    >or something else. Is the best way to do this using a HyperlinkListener or
    >something else?


    Fill it full of stylised, perfect, simplified HTML. Then you can get
    notified when someone clicks on something.
    --
    Roedy Green Canadian Mind Products http://mindprod.com
    Students who hire or con others to do their homework are as foolish
    as couch potatoes who hire others to go to the gym for them.
    Roedy Green, Dec 16, 2012
    #3
  4. HawkLane

    HawkLane Guest

    Thank you for your help very nice. This works, but we want the use to be
    able to switch from editable to non-editable (system will find what words
    should be underlined).

    When I go to the editable state, the text that I type after the linked
    word is also with href formatting, i.e. blue and underlined, how can I
    make it plain again instead?
    HawkLane, Dec 24, 2012
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gerrit Hulleman

    Get selected text from JEditorpane as HTML

    Gerrit Hulleman, Jul 1, 2004, in forum: Java
    Replies:
    1
    Views:
    2,017
    Chris Smith
    Jul 1, 2004
  2. Guest
    Replies:
    1
    Views:
    506
    Andrew Thompson
    Sep 19, 2004
  3. Robin
    Replies:
    0
    Views:
    711
    Robin
    May 12, 2005
  4. Larry Barowski
    Replies:
    0
    Views:
    919
    Larry Barowski
    Jan 24, 2006
  5. Ross Clement (Email address invalid - do not use)

    Antialised text in JEditorPane

    Ross Clement (Email address invalid - do not use), Feb 2, 2006, in forum: Java
    Replies:
    2
    Views:
    2,091
    Ross Clement (Email address invalid - do not use)
    Feb 3, 2006
Loading...

Share This Page