setCaretColor usage?

I have a vision screen with black background that has multiple Text Fields and Numeric Text Fields for user input. Against the black background the text cursor is impossible to see. Can i change the color of the text cursor using setCaretColor? Has anyone done this before that could share some coding? I’ve searched but can’t find much of anything that is useful floating around the web.

Thanks
Dale

It should be as simple as

from java.awt import Color
event.source.setCaretColor(Color.GREEN)

if you put that on the text field’s focus gained or something, it will set the caret color to green.

Thank you Sir! Works perfectly now, I had neglected to import the Color class.

Respectfully,
Java neophyte

1 Like