# Progress bar text color

**URL:** <https://forum.inductiveautomation.com/t/progress-bar-text-color/18752>\
**Category:** Ignition\
**Created:** [July 6, 2018, 11:08am UTC](https://forum.inductiveautomation.com/t/progress-bar-text-color/18752 "2018-07-06T11:08:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanko25](https://avatars.discourse-cdn.com/v4/letter/v/a87d85/32.png) [@vanko25](https://forum.inductiveautomation.com/u/vanko25)\
**Post date:** [July 6, 2018, 11:08am UTC](https://forum.inductiveautomation.com/t/progress-bar-text-color/18752/1 "2018-07-06T11:08:17Z")

</div>

Hi all,

I am looking at how to change the progress bar text color. I have tried using selectionForeground and selectionBackground on propertyChange script but it comes back with an error saying it is not an actual property of the progressBar object. Any ideas? Thanks!

```auto
if event.propertyName == "value":
	event.source.selectionForeground = system.gui.color(0,0,0)
	event.source.selectionBackground = system.gui.color(0,0,0)

```

```auto
Traceback (most recent call last):

  File "<event:propertyChange>", line 2, in <module>

AttributeError: 'com.inductiveautomation.factorypmi.application.com' object has no attribute 'selectionForeground'

Ignition v7.9.6 (b2018012914)
Java: Oracle Corporation 1.8.0_162

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 6, 2018, 1:26pm UTC](https://forum.inductiveautomation.com/t/progress-bar-text-color/18752/2 "2018-07-06T13:26:14Z")

</div>

[Per the documentation](https://docs.inductiveautomation.com/display/DOC79/Progress+Bar), the property names are `.foreground` and `.background`. Where did you get ‘selection’?

---

<div class="post-metadata">

**Author:** ![vanko25](https://avatars.discourse-cdn.com/v4/letter/v/a87d85/32.png) [@vanko25](https://forum.inductiveautomation.com/u/vanko25)\
**Post date:** [July 9, 2018, 8:23am UTC](https://forum.inductiveautomation.com/t/progress-bar-text-color/18752/3 "2018-07-09T08:23:03Z")

</div>

Foreground and Background are for the progress bar level not for the text unfortunately. The selectionForeground and selectionBackground are from the JprogressBar docs from Java.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 9, 2018, 12:11pm UTC](https://forum.inductiveautomation.com/t/progress-bar-text-color/18752/4 "2018-07-09T12:11:35Z")

</div>

> [@vanko25](#):
>
> The selectionForeground and selectionBackground are from the JprogressBar docs from Java.

Those methods don't appear in the [documentation for JProgressBar](https://docs.oracle.com/javase/8/docs/api/javax/swing/JProgressBar.html), nor in its ancestor classes.

---

<div class="post-metadata">

**Author:** ![esmarks](https://avatars.discourse-cdn.com/v4/letter/e/e47774/32.png) [@esmarks](https://forum.inductiveautomation.com/u/esmarks)\
**Post date:** [September 25, 2018, 2:23pm UTC](https://forum.inductiveautomation.com/t/progress-bar-text-color/18752/5 "2018-09-25T14:23:46Z")

</div>

Hello Forum, Has anyone figured out a method for changing the text color of the progress bar?

---

<div class="post-metadata">

**Author:** ![wg1](https://avatars.discourse-cdn.com/v4/letter/w/96bed5/32.png) [@wg1](https://forum.inductiveautomation.com/u/wg1)\
**Post date:** [April 1, 2020, 8:34pm UTC](https://forum.inductiveautomation.com/t/progress-bar-text-color/18752/6 "2020-04-01T20:34:34Z")

</div>

I know this is old, but I was successful using the code below.

```auto
from javax.swing import UIManager
UIManager.put("ProgressBar.selectionForeground", Color.black);
UIManager.put("ProgressBar.selectionBackground", Color.black);

```
