如何更改光标闪烁颜色? [英] How to change the cursor blink color?

查看:188
本文介绍了如何更改光标闪烁颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道这是否可能?


但是我想改变这个光标闪烁颜色......这通常是黑色....


i我正在制作一个基于java-swing的项目在那...其中一个要求是改变光标闪烁的颜色....


这可能吗?

I don't know this is possible or not?

But i want to change the this cursor blink color...which is normally black....

i am making one java-swing based project and in that...one of the requirement is to change the color of the cursor blink....

Is this possible?

推荐答案

光标用于指代不闪烁的鼠标光标。

"Cursor" is used to refer to the mouse cursor which does not blink.

所以,我假设你在谈论文本组件中使用的插入符号:

So, I assume you are talking about the caret which is used in a text component:

textField.setCaretColor(...);

编辑:

上述建议确实如此它适用于一个文本字段。要为所有文本字段更改它,您应该可以在程序开头使用以下内容:

The above suggestion does it for one text field. To change it for all text fields you should be able to use the following at the start of your program:

UIManager.put("TextField.caretForeground", new ColorUIResource(...));

这篇关于如何更改光标闪烁颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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