How to use the <a href> tag in JTextPane
I have a JTextPane that displays a link where a click should open a page in a browser.
The link is set as text in a TextPane , as shown below:
<a href=http://www.google.com target=_blank>Read more..</a> Also shown below is how the link looks in my panel:

When I click on it, nothing happens, does anyone know why?
+4
2 answers
Either JTextPane must be non-editable, as indicated by BegemoT, or you can use this http://java-sl.com/tip_links_in_editable.html to allow links in the editable area.
+3