Progress bar text in power table

Hi,
I managed to display a progress bar in a power table using the following code:

if colName == "Status":
		from javax.swing import JProgressBar
		from java.awt import Color
		
		bar = JProgressBar(0,100, setPaintedString=Ture)
		bar.background = Color.WHITE
		bar.foreground = Color.BLUE
		
               bar.setValue(int(value))
		
		return {'renderer': bar}

i wounder if it is possible to change the font type and size, and if it is possible to change the alignment of the text (put it on the right of the progress bar). Thanks in advance

Hey,
I have also tried to show the value as string. Without the “setStringPainted” it works fine.
But as soon as I add this part, the progress bar disappears…

	if rowIndex == 2 and colIndex == 2:
		from javax.swing import JProgressBar
		from java.awt import Color

		bar = JProgressBar(0,500)
		bar.background = Color.WHITE
		bar.foreground = Color.BLACK
		

		bar.setValue(80)
		bar.setStringPainted(true)
		return {'renderer': bar}

does anybody know how to fix that?
Thank You (:slight_smile:

1 Like

you can try to set the stringPainted in the constructor:

bar = JProgressBar(0,500,StringPainted=True)

Change true to True

1 Like

Thank you jpark, now it works!
Is there a way to change the value from percentage to the value itself?

1 Like