hyperlink in java

2020-04-17 03:40发布

问题:

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!