在JtextPane中更改鼠标指针 [英] Changing the mouse pointer in JtextPane

查看:217
本文介绍了在JtextPane中更改鼠标指针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 JTextPane ,其内容类型为 text / plain 。我将一些文本设置为 JTextPane ,它包含一些显示 URL 的文本。当我将鼠标指向该文本时,我想更改鼠标指针。
这个功能可以实现吗?
注意:我的 JTextPane 的内容为 text / plain 。它无法更改为 text / html

I have a JTextPane which has the content type text/plain. I set some texts to that JTextPane and it contain some texts which display URLs. I want to change the mouse pointer when I point the mouse to that text only into the hand pointer. Is this function achievable? Note: I have the content of the JTextPane as text/plain. It cannot be changed to text/html

thanx

推荐答案

你可以试试这个:

pane.setCursor(new Cursor(Cursor.HAND_CURSOR));

其中窗格是你的 JTextPane

这篇关于在JtextPane中更改鼠标指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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