Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

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
16,120
2,397
Lard
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.