Progress Bar used as Health Bar
问题 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. 来源: https://stackoverflow.com/questions/10468267/progress