Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the cursor blink color?

Tags:

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?

like image 480
Nitz Avatar asked Dec 22 '22 03:12

Nitz


1 Answers

"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(...);

Edit:

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(...));
like image 188
camickr Avatar answered Jan 02 '23 15:01

camickr