Is there any method to create clickable hyperlink in JTextArea in Java?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
One way you can do it if you absolutely want to use the jTextArea is to get the User MouseClick(x,y) location and then handle from there.
However, the easier way out would be to use a JEditorPane. Maybe this link will help:
http://www.apl.jhu.edu/~hall/java/Swing-Tutorial/Swing-Tutorial-JEditorPane.html
Cheers!