• Post Reply Bookmark Topic Watch Topic
  • New Topic

change progressBar look and feel  RSS feed

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Make these the first lines in your main method. Essentially this should be defined before you create any progress bar objects.
 
swapnel surade
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the solution you've given is working
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



this snippet applies the system level UI changes to application.

is there any way to change the shape of the progress bar box.

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!