java中的超链接 [英] hyperlink in java

查看:704
本文介绍了java中的超链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何方法可以在Java中的JTextArea中创建可点击的超链接?

Is there any method to create clickable hyperlink in JTextArea in Java?

推荐答案

如果你绝对想要使用jTextArea,你可以做到的一种方法是获取用户MouseClick(x,y)位置,然后从那里处理。

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.

然而,更简单的方法是使用JEditorPane。也许这个链接会有所帮助:

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

干杯!

这篇关于java中的超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆