Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Converting plain text into embedded hyperlink

807606May 9 2007 — edited May 9 2007
I'm attempting to output text whereby the majority of it will be simple plain text, but I would like some sentences to be converted to a hyperlink which when clicked will allow me to display a document held in a database.

What would be the best way of accomplishing this? Basically every sentence has a flag set, when I process each sentence I check the flag and based on this I would like to display as is or as a hyperlink.

At the moment I am outputting in a JTextPane but can change that if required.

Thanks in advance. :)

EDIT: Just thought I'd clarify a little - I don't need the text to be a hyperlink in the traditional sense of the word but merely for the text to be clickable, allow the program to recognise which text passage has been clicked, and act appropriately.

Message was edited by:
thoseion
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 6 2007
Added on May 9 2007
6 comments
418 views