How to change the cursor blink color?

后端 未结 1 449
滥情空心
滥情空心 2021-01-19 10:31

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 proje

相关标签:
1条回答
  • 2021-01-19 10:52

    "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(...));
    
    0 讨论(0)
提交回复
热议问题