So, I have a JEditorPane
with a bunch of text, and I want to be able to click on some the text enclosed in a tag, and have it activate some function, similar to the onclick
in JavaScript with HTML. I've tried doing this with href
s and <a>
tags, but as I was not going to a website, it didn't work out for me.
So, how can I click on text enclosed in a tag in a JEditorPane
and then do something accordingly?