You doubt it. You use the Swing tag, but also use the TextArea text, which is an AWT component, not a Swing component.
I would suggest that you use Swing and use JTextArea. In this case, you can add a "highlight" to the specified. Here is a special class that allows you to use Rectangle Painter for this selection.
source
share