Results 1 to 3 of 3
  1. #1
    javanewbie is offline Member
    Join Date
    Jun 2008
    Location
    Australia
    Posts
    43
    Rep Power
    0

    Exclamation How to create a hyperlink from a text in Java

    Hello,

    Is there any available/example of source codes that makes a text have the ability to link itself.

    Upon clicking the text, a browser will open and redirect to http: // www. link.com


    Yes, I already have the idea that I'll be using a JEditorPane. :confused: What I would like to ask is to give me at least a set of codes on how does it work. Thanks.

    Your help is highly appreciated.
    Last edited by javanewbie; 06-04-2009 at 09:36 AM.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default

    You're on the right track. Use a JEditorPane with setEditable(false) and a HyperlinkListener.

    db

  3. #3
    makpandian's Avatar
    makpandian is offline Senior Member
    Join Date
    Dec 2008
    Location
    Chennai
    Posts
    444
    Rep Power
    6

    Default

    if your text is on button,YOu can use action event to do so..
    Mak
    (Living @ Virtual World)

Similar Threads

  1. How to write a hyperlink in properties file?
    By MAGNUM in forum New To Java
    Replies: 1
    Last Post: 02-12-2009, 04:16 AM
  2. Hyperlink in swing
    By aneesahamedaa in forum AWT / Swing
    Replies: 1
    Last Post: 07-28-2008, 03:41 PM
  3. [SOLVED] Hyperlink
    By Mir in forum New To Java
    Replies: 91
    Last Post: 07-09-2008, 11:37 AM
  4. Hide hyperlink address on status bar
    By simon in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 07-24-2007, 10:34 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
  •