• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how do i get the default button backgrounds?

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am implementing a recording facility for my software, and am trying to implement the buttons so that when the record button is pressed, a boolean is switched and the colour of the buttons back ground is set top red.

This all works fine, but when i try and change it back when i press the stop button, it simply changes to a solid blue and not the nice pretty faded blue, metal kind of look that is offered as a default.

If any one can tell me how to set the back ground to the default that would be great.
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
button.setBackground(UIManager.getColor("Button.background"));
 
Andrew Brown
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much that was more than helpful.

Dont suppose you know how to undepress the buttons. I have a play mechanism, and at the moment while it is playing, it stays depressed, i want to change it green whilst irt is playing, but it wont undepress whilst its playing.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> I have a play mechanism

must be in a separate thread than the EDT

http://java.sun.com/docs/books/tutorial/essential/threads/
http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html
http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html
 
reply
    Bookmark Topic Watch Topic
  • New Topic