0

I have a JProgressBar drawn on a JPanel to show a static value. I can get everything working fine apart from one thing, the colour. If I use

ProgressBarServ1.setForeground(Color.red);
ProgressBarServ1.setBackground(Color.blue);

then I get a red, or any colour I pick, percentage number in the progress bar (that's ok) but I don't get a blue bar. I always get a mid brown/bronze colour.

I've had a good look through google and there doesn't seem to be a good answer.

The duplicate you point to doesn't actually give an answer, just discussion!

Martin.

m ainsworth
  • 49
  • 1
  • 6
  • Also check this topic, it has additional solutions : http://stackoverflow.com/questions/11802887/nimbus-lf-change-background-color-of-progress-bar/11803010#11803010 – Arnaud Jun 10 '16 at 14:00
  • I'd read that one and I understand that the UIManager.put commands are effectively changing the default values. But where do I put the UIManager code as I cannot get it to make any changes! – m ainsworth Jun 10 '16 at 14:25
  • You'd better place this code before any UI components get created. – Arnaud Jun 10 '16 at 14:30
  • Placed them into public MainJFrame as the first entry and before initComponents(). But still no colour change. – m ainsworth Jun 10 '16 at 15:07

0 Answers0