Mac Java JProgressBar color

Josh

macrumors 68000
Mar 4, 2004
1,640
1
State College, PA
Before creating the progress bar, add these lines:
Code:
UIManager.put("ProgressBar.selectionBackground",Color.BLUE);
UIManager.put("ProgressBar.selectionForeground",Color.WHITE);
Change the colors as needed.

(got this from a google search)
 

NewbieNerd

macrumors 6502a
Original poster
Sep 22, 2005
512
0
Chicago, IL
Josh said:
Before creating the progress bar, add these lines:
Code:
UIManager.put("ProgressBar.selectionBackground",Color.BLUE);
UIManager.put("ProgressBar.selectionForeground",Color.WHITE);
Change the colors as needed.

(got this from a google search)
Yeah, I found that, but it doesn't seem to work for me.
 

NewbieNerd

macrumors 6502a
Original poster
Sep 22, 2005
512
0
Chicago, IL
Okay, so it can be done if you use a different LookAndFeel ( I tried the Metal one ) instead of the default Aqua, but (a) I don't really want to change from Aqua, and (b) that doesn't allow me to change after creating stuff.
 

bousozoku

Moderator emeritus
Jun 25, 2002
13,979
3
Gone but not forgotten.
NewbieNerd said:
Okay, so it can be done if you use a different LookAndFeel ( I tried the Metal one ) instead of the default Aqua, but (a) I don't really want to change from Aqua, and (b) that doesn't allow me to change after creating stuff.
Aqua is Aqua, you can't change it except for blue and graphite.

You could probably find a look-and-feel that's similar that can be modified and that one might take fewer resources to run.
 

NewbieNerd

macrumors 6502a
Original poster
Sep 22, 2005
512
0
Chicago, IL
bousozoku said:
Aqua is Aqua, you can't change it except for blue and graphite.

You could probably find a look-and-feel that's similar that can be modified and that one might take fewer resources to run.
Yeah, makes perfect sense. I had figured the same since I first started trying to figure out how, but my boss thought it would look nice to turn the bar green/yellow/red, and I have very little GUI experience so I couldn't argue.

So obviously part of this is showing the status of something, best represented by the traditional stop light colors. Anyone have a creative way to do it? I'm trying to figure the Graphics2D stuff out to do it that boring way, but I'm interested if anyone has any brighter ideas.