Progress bar text color

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!

if event.propertyName == "value":
	event.source.selectionForeground = system.gui.color(0,0,0)
	event.source.selectionBackground = system.gui.color(0,0,0)
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

Per the documentation, the property names are .foreground and .background. Where did you get ‘selection’?

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.

Those methods don't appear in the documentation for JProgressBar, nor in its ancestor classes.

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

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

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