在JTextField中使用自定义Caret进行访问 [英] Using custom Caret in JTextField for accessibility

查看:145
本文介绍了在JTextField中使用自定义Caret进行访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个Swing应用程序,我有一个朋友读了很多圣经。此应用程序按文字或段落进行搜索。

I'm programming a Swing Application and I have a friend that read much the Bible. This app have searches by text or passage.

但我的朋友只能看到大字体对比色 。我用 setCaretColor 更改 textField 的插入符的颜色,用户输入要搜索的文本。

But my friend only can see big font sizes and contrasted colors. I change the color of caret for the textField with setCaretColor, where the user input the text to search.

插入符号显示为具有相同 hight 字体的矩形,但宽度很少,我认为我的朋友可以看不到。

The caret show like a rectangle with the same hight of font, but the width is little and I think that my friend cans not see.

有没有办法更改插入符号的宽度以显示更大?

Is there any way for change the width of the caret for show more bigger?

推荐答案

你是否看过Oreilly Swing书中的这个例子,这本书漂浮在互联网上?您似乎可以自定义插入符号。

Have you seen this example from the Oreilly Swing book that's floating all over the internet? It seems you can customize the caret a lot.

http://www.java2s.com/Code/Java/Swing-JFC/Fanciercustomcaretclass.htm

这篇关于在JTextField中使用自定义Caret进行访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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