| Author |
change progressBar look and feel
|
swapnel surade
Ranch Hand
Joined: Mar 05, 2009
Posts: 129
|
|
Hi,
I have shown a progress bar in my application.
when value of progress bar increases it get filled with color.
I want to change that color of my choice.
how I can do that ??
thanks
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8439
|
|
Make these the first lines in your main method. Essentially this should be defined before you create any progress bar objects.
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
swapnel surade
Ranch Hand
Joined: Mar 05, 2009
Posts: 129
|
|
but we are not mentioning any object reference to progressBar instance.
How UIManager going to understand which object it should refer ?
|
 |
swapnel surade
Ranch Hand
Joined: Mar 05, 2009
Posts: 129
|
|
|
the solution you've given is working
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8439
|
|
Check out the source code for the BasicProgressBarUI and see where and how it uses these properties.
The source code can be found in a file called src.zip in your java installation directory
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8439
|
|
swapnel surade wrote:the solution you've given is working
Is it?
Now add UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); before you create the UI and see what happens
|
 |
swapnel surade
Ranch Hand
Joined: Mar 05, 2009
Posts: 129
|
|
this snippet applies the system level UI changes to application.
is there any way to change the shape of the progress bar box.
|
 |
santhosh varala kumar
Greenhorn
Joined: Nov 05, 2009
Posts: 25
|
|
|
In that case you need to overrite your own basic progressbar ui so that while painting it will under go and draw how we have specified.
|
 |
 |
|
|
subject: change progressBar look and feel
|
|
|