答案 0 :(得分:0)
你不是在找"进度条"?见:https://docs.oracle.com/javase/tutorial/uiswing/components/progress.html
答案 1 :(得分:0)
您只需使用drawRect
绘制轮廓并填充fillRect
g.drawRect(x, y, width, height);
g.fillRect(x, y, (int)(width * percent), height); //where percent is 0.0 - 1.0