Changing the mouse pointer in JtextPane

痴心易碎 提交于 2019-12-01 21:21:16

You could try this:

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

Where pane is your JTextPane.

camickr

Did you read my answer in your posting on Adding tooltips to JTextPane?

Well the concept is the same. You use a MouseListener and convert the mouse point to get the text at the caret position. When you are over a url text then you change the cursor.

The Utilities class might help you access the text at the caret location.

If you need more help then post your SSCCE that shows what you have tried and shows what problems you are having.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!