Possible Duplicate:
Nice looking progress bar in java
Working with progressbar
how to change color of jprogressbar in swing using netbeans,by default it taking Orange,i used setbackground but no changes,kindly tell me any easy way.
Possible Duplicate:
Nice looking progress bar in java
Working with progressbar
how to change color of jprogressbar in swing using netbeans,by default it taking Orange,i used setbackground but no changes,kindly tell me any easy way.
I'm assuming that while you're implementing your code in NetBeans
you're using the Nimbus
look-and-feel
.
It would better serve you to go through these links to understand how you can customize the defaults for this LnF
The following couple of SO articles might also come in handy for you:
Here's a good test to see what JProgressBar colors are:
JFrame frame = new JFrame("ProgressBar test");
frame.setSize(300, 300);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
JPanel panel = new JPanel();
frame.add(panel);
JProgressBar pb = new JProgressBar(50, 100);
pb.setMinimum(0);
pb.setMaximum(100);
pb.setValue(75);
pb.setForeground(Color.orange);
pb.setBackground(Color.green);
panel.add(pb);
frame.setVisible(true);
You will see from that that setForeground will set the color of the current progress, and setBackground the color of the remaining