How to change JProgressBar color?

Ali Bassam picture Ali Bassam · May 27, 2012 · Viewed 47.2k times · Source

I Used .setBackground and .setForeground and they didn't work, the color is like Orange, can't change it.

Answer

mKorbel picture mKorbel · May 27, 2012

I think that these values are right for you

UIManager.put("ProgressBar.background", Color.ORANGE);
UIManager.put("ProgressBar.foreground", Color.BLUE);
UIManager.put("ProgressBar.selectionBackground", Color.RED);
UIManager.put("ProgressBar.selectionForeground", Color.GREEN);