• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get the Underlined text in JTextPane  RSS feed

 
Rinkesh Modi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JtextPane with text say "i like java it is a good language".
in the above text suppose i have made "like java" and "good language" text underlined. And i have added a mouse listener to this JTextpane. the whole idea is to create a hyperlink so that when the user clicks anywhere on "like java" then i want to get the complete text("like java") where i clicked and using this text i want to do some operation. How can i get the underlined text?

thanks.
 
Ted Smyth
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SwingX provides a Hyperlink component that's very functional. Try it out!

(download binaries/source/docs at http://swinglabs.org/downloads.jsp)
[ June 12, 2008: Message edited by: Ted Smyth ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!