Progress Bar used as Health Bar

2019-02-24 23:50发布

问题:

I am making a java game that has a sidebar that displays a player's health. I want the bar to be like a progress bar which is along the lines of the picture below:

Would a progress bar be capable enough to accomplish this? If not, what will?

回答1:

If you want an "official" answer, then yes, a JProgressBar can do this easily. I suggest that you give it a try and let us know how it works out, especially if you have any problems with it.