2015-09-06 79 views
0
 UIManager.put("jb.selectionForeground", new ColorUIResource(Color.BLACK)); 
    UIManager.put("jb.selectionBackground", new ColorUIResource(Color.BLACK)); 

我试过这种方法,但它不工作。如何更改JProgressBar文本颜色

+0

http://stackoverflow.com/questions/10773978/how-to-change-jprogressbar-color的重复 – Satya

回答

0

您可以方便地设置的JProgressBar文本颜色使用: -

UIManager.put("ProgressBar.selectionBackground", Color.RED);//Red 
UIManager.put("ProgressBar.selectionForeground", Color.GREEN);//Green 
UIManager.put("ProgressBar.background", Color.ORANGE);//Gives Orange 
UIManager.put("ProgressBar.foreground", Color.BLUE);//Gives Blue 

对于更多信息,请到:How to change JProgressBar color?

乐意帮助!