2015-09-06 174 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?

樂意幫助!