aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes how do i get the default button backgrounds? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how do i get the default button backgrounds?" Watch "how do i get the default button backgrounds?" New topic
Author

how do i get the default button backgrounds?

Andrew Brown
Greenhorn

Joined: Apr 10, 2006
Posts: 25
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.


Thanks for any help anyone can offer.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
button.setBackground(UIManager.getColor("Button.background"));
Andrew Brown
Greenhorn

Joined: Apr 10, 2006
Posts: 25
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

Joined: Jun 09, 2003
Posts: 4632
> 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how do i get the default button backgrounds?
 
Similar Threads
Changing the content of HTML dynamically from a JSP
how to set back ground color to the table.
Question on radio button
Change color of JButtons in Java 5.0
Clear just the back history... [Urgent]