• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hyperlinks In Textareas

 
silent requiem
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Help the Canadian junior programmer type!
I'm trying to create a webpage (entirely Java based) that will use hyperlinks to open up a picture in a new web browser window. Essentially, the question is "How do I put a hyperlink into a TextArea?" - if it can be done?
I have seen similar posts elsewhere, but they got no responses. I figured Java Ranch would be the place to look....
Thanks muchly...
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If you want to use HTML objects (i.e., hyper links) you need to use JTextPane which handles HTML objects. TextArea will not handle it for you.
NOTE: That can't be your real name ... please read the JavaRanch naming policy here
Regards,
Manfred.
[This message has been edited by Manfred Leonhardt (edited November 21, 2001).]
 
Michael Brown
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Canadian Stands Corrected -
My apologies Manfred - I'll try to read the guide more carefully next time
However, I will try the JTextPanes. I did find an applet online (free sample one) that was a horizontal text scroller applet. The author did not use a single JTextPane in the program, but was able to put html hyperlinks into the program by using parameters in the html code... a search of the code (I am using TextPad4 as my java editor right now... am a starting programmer) didn't reveal any usage of JTextPane. However, as true as it is that I am dissecting the code to see how it was done, I wondered if there was an easier way. Thanks for the prompt response and I'll give it a shot.
Mike
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic