# setCaretColor usage?

**URL:** <https://forum.inductiveautomation.com/t/setcaretcolor-usage/16941>\
**Category:** Ignition\
**Created:** [February 9, 2018, 6:33pm UTC](https://forum.inductiveautomation.com/t/setcaretcolor-usage/16941 "2018-02-09T18:33:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Earnhardt\_3](https://avatars.discourse-cdn.com/v4/letter/e/9f8e36/32.png) [@Earnhardt\_3](https://forum.inductiveautomation.com/u/Earnhardt_3)\
**Post date:** [February 9, 2018, 6:33pm UTC](https://forum.inductiveautomation.com/t/setcaretcolor-usage/16941/1 "2018-02-09T18:33:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mrogers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mrogers/32/4110_2.png) [@mrogers](https://forum.inductiveautomation.com/u/mrogers)\
**Post date:** [February 9, 2018, 7:01pm UTC](https://forum.inductiveautomation.com/t/setcaretcolor-usage/16941/2 "2018-02-09T19:01:25Z")

</div>

It should be as simple as

```auto
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.

---

<div class="post-metadata">

**Author:** ![Earnhardt\_3](https://avatars.discourse-cdn.com/v4/letter/e/9f8e36/32.png) [@Earnhardt\_3](https://forum.inductiveautomation.com/u/Earnhardt_3)\
**Post date:** [February 9, 2018, 7:16pm UTC](https://forum.inductiveautomation.com/t/setcaretcolor-usage/16941/3 "2018-02-09T19:16:52Z")

</div>

> [@mrogers](#):
>
> Color

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

Respectfully,  
Java neophyte
