[SOLVED] Progressbar colour change

Discuss here any questions about the WebLaF library.
Bugs can be posted directly to GitHub issues tracker.

[SOLVED] Progressbar colour change

Postby Hamlam » Mon Nov 18, 2013 10:49 pm

Hey all.
I have added the web look and feel to my project.
I have a progress bar that when it fills up its blue, however with look and feel it is white and the background of
the progress bar is also white. Is there a way to change the colour of it? thanks
Hamlam
 
Posts: 2
Joined: Mon Nov 18, 2013 10:46 pm

Re: Progressbar colour change

Postby mgarin » Tue Nov 19, 2013 2:23 pm

That is a pretty vague explanation.
Could you provide some screenshots and example code for the case?
User avatar
mgarin
Site Admin
 
Posts: 223
Joined: Mon Apr 16, 2012 1:01 pm
Location: Russia, Saint-Petersburg

Re: Progressbar colour change

Postby Hamlam » Tue Nov 19, 2013 11:25 pm

http://snag.gy/E4yVn.jpg

here with weblookandfeel you can see the progress bars colour is white on white.

Without installing web look and feel the bar is blue as it fills up
Hamlam
 
Posts: 2
Joined: Mon Nov 18, 2013 10:46 pm

Re: Progressbar colour change

Postby mgarin » Wed Nov 20, 2013 12:47 pm

You can modify global progress bar style by specifying values for WebProgressBarStyle class variables.
The exact variables you need to modify to change progress background are:
Code: Select all
WebProgressBarStyle.bgTop
WebProgressBarStyle.bgBottom
WebProgressBarStyle.progressTopColor
WebProgressBarStyle.progressBottomColor

You can also pass the same values directly into WebProgressBar instance if you are using WebProgressBar instead of JProgressBar - in that case only that instance of WebProgressBar will be affected by the changes.
User avatar
mgarin
Site Admin
 
Posts: 223
Joined: Mon Apr 16, 2012 1:01 pm
Location: Russia, Saint-Petersburg

Re: Progressbar colour change

Postby petermacgonagan » Sun Sep 07, 2014 6:41 pm

This is great! Now, I can customize my progressbar. Thank you very much :)
petermacgonagan
 
Posts: 9
Joined: Wed Sep 03, 2014 10:57 pm

Re: Progressbar colour change

Postby mgarin » Mon Sep 08, 2014 9:31 am

I guess this one is also solved :)
User avatar
mgarin
Site Admin
 
Posts: 223
Joined: Mon Apr 16, 2012 1:01 pm
Location: Russia, Saint-Petersburg


Return to Questions

Who is online

Users browsing this forum: No registered users and 1 guest

cron