Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how do i get the default button backgrounds?

 
Andrew Brown
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • 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.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
button.setBackground(UIManager.getColor("Button.background"));
 
Andrew Brown
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic