1

I need user be able to enter text in input form's Text Area and be able to make clickable links in some part of that text (Links are inserted by a button in form and are references to other places in application and are not WWW links).
How can I do this?
Is there any component for this?

Ariyan
  • 14,760
  • 31
  • 112
  • 175
  • 3
    Please have a look at this [example](http://stackoverflow.com/questions/10462725/actionlistener-for-a-specific-text-inside-a-jtextarea/10463120#10463120). I think you can use, [modelToView(...)](http://docs.oracle.com/javase/7/docs/api/javax/swing/plaf/TextUI.html#modelToView(javax.swing.text.JTextComponent, int)) and [viewToModel(...)](http://docs.oracle.com/javase/7/docs/api/javax/swing/plaf/TextUI.html#viewToModel(javax.swing.text.JTextComponent, java.awt.Point)), for this case. – nIcE cOw Jul 01 '12 at 06:02
  • 1
    I already up-voted nice cow's answer. Can't do it again. :( – Hovercraft Full Of Eels Jul 01 '12 at 06:09
  • @AndrewThompson : hehe, thankx :-), I did right clicked them. Seems like some issues with spacing . Seems to me, whenever there are brackets in the link, it happens this way, though if I won't put this in comments and put this answers instead, then this won't happen. Then they will format as expected :( – nIcE cOw Jul 01 '12 at 10:46
  • @nIcEcOw If you paste the ' right click copied' URL in a little utility and convert it to URI it should also work for answer or comment. I just open the page though.. Tips I picked up from the Usenet days. ;) – Andrew Thompson Jul 01 '12 at 11:14
  • 1
    @AndrewThompson: I didn't meant any particular component; I just want to make it done (with any possible component) & I used Text Area as a general phrase! anyway I think you're right and it made some misunderstandings so I did some space jobs. Thanks – Ariyan Jul 01 '12 at 12:43
  • Good edit. That is more clear. :) – Andrew Thompson Jul 01 '12 at 13:58

0 Answers0