Possible Duplicate:
Progress Bar used as Health Bar
Refer to: Progress Bar used as Health Bar
When I read the JProgressBar api, it show the maximum as the end of a task. I want the maximum to be a player's health, such as 90/100. How could I be able to do that?
Basically, I want the bar to display 90/100 when the player's health is 90.
I tried:
JProgressBar health = new JProgressBar(0, 50);
health.setStringPainted(true);
health.setForeground(Color.GREEN);
// ???