How to select/highlight an entire row in JTextPane
I stumbled upon a question here when googling for a solution for my problem, it's not quite my problem, but rather close. Originally tried to post the url, but I can't post the link due to low post count. It's titled "How to select/highlight an entire row in JTextArea".
So, I figured I'd try my luck and see if anyone could help me with my specific problem here:
I've got a JTextPane full of lines of text. When I click on a particular point in the JTextPane and if there is a line of text across that point, I want that line of text is selected and high-lighted. I'd also like it to search for that particular String of text in an adjacent JTextPane when selecting it. How to do this? I'd prefer avoiding "extends" and "implements" if possible, seeing how the class is already quite full of stuff and either of those could mess things up quite a bit.