I wanted to add a MouseListener to a JTextArea. In the mousePressed method I'd like to select the current word where the mouse cursor points to. Clicking with the left mouse button I could call 'JTextArea#getCaretPosition' to determine the index / position. But that doesn't work with the right mouse button.
So here comes my question: Isn't there a possibility to get the index / position from the Point of a mouse click (e.g. like JList#locationToIndex)?
Censorship is the younger of two shameful sisters, the older one bears the name inquisition. -- Johann Nepomuk Nestroy