【发布时间】:2012-05-27 12:28:23
【问题描述】:
我用了.setBackground和.setForeground,都不行,颜色像橙色,改不了。
【问题讨论】:
标签: java swing colors jprogressbar
我用了.setBackground和.setForeground,都不行,颜色像橙色,改不了。
【问题讨论】:
标签: java swing colors jprogressbar
我认为这些价值观适合你
UIManager.put("ProgressBar.background", Color.ORANGE);
UIManager.put("ProgressBar.foreground", Color.BLUE);
UIManager.put("ProgressBar.selectionBackground", Color.RED);
UIManager.put("ProgressBar.selectionForeground", Color.GREEN);
【讨论】:
UIManager;另见alternative。
您应该将 setStringPainted 属性设置为 true:
progressBar.setStringPainted(true);
progressBar.setForeground(Color.blue);
progressBar.setString("10%");
【讨论】: