In a textarea, suppose a mouse is clicked at a certain place. How to find on which word was the mouse clicked. Is there any support in Java to do this?
In a textarea, suppose a mouse is clicked at a certain place. How to find on which word was the mouse clicked. Is there any support in Java to do this?
You can add a CaretListener to your JTextArea. Then you can use methods of String class to detect start and end of the word on which the mouse is.