Results 1 to 2 of 2
- 01-07-2013, 02:48 PM #1
Member
- Join Date
- Sep 2012
- Posts
- 11
- Rep Power
- 0
JTextPane , MouseListener on certain words.
Hello,
I have an jTextPane wich displays search results from a database. I Would like to make certain words active to a MouseListener , i have done some searches but i am afraid that it is only possible to make the whole JTextPane do the same thing with MouseListener.
Would it be possible to have certain words do certain things?
Best Regards
Rickard
- 01-07-2013, 03:15 PM #2
Re: JTextPane , MouseListener on certain words.
There's probably better ways to do it, but one option would be to add the MouseListener to your JTextPane as you said, and inside of your mouseReleased() method, call getSelectedText() on the JTextPane, and if the returned value is the String you are interested in, perform your action.
Similar Threads
-
Help with mouselistener
By kastraki2000 in forum Java AppletsReplies: 2Last Post: 04-30-2011, 03:56 PM -
can't get x and y from mouselistener
By j2me64 in forum Java 2DReplies: 3Last Post: 04-24-2010, 04:57 PM -
MouseListener & GUI
By Suurisa in forum New To JavaReplies: 2Last Post: 10-27-2009, 12:52 AM -
i need help for MouseListener
By sfaxianovic in forum New To JavaReplies: 2Last Post: 08-21-2008, 03:30 AM -
MouseListener
By Aswq in forum New To JavaReplies: 12Last Post: 07-18-2008, 08:10 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks