How to add text on jprogressbar?

Siddhu picture Siddhu · Aug 2, 2012 · Viewed 25.5k times · Source

I am using a jprogressbar to indicate the availability status. i want to display a text of 40%[assumption] inside the progressbar. how to do it? the text was changed according to the availability value

Answer

Reimeus picture Reimeus · Aug 2, 2012

You can use:

Initialising:

progressBar.setStringPainted(true);

Updating:

progressBar.setValue(newValue);