aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes button colors, etc. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "button colors, etc." Watch "button colors, etc." New topic
Author

button colors, etc.

ken zemaitis
Ranch Hand

Joined: Sep 26, 2005
Posts: 42
hi everyone. i am still fairly new to java, and after creating this SMALL calculator program, id like to change the colors of the buttons, and perhaps the background. if anyone can help me out here it would be greatly appreciated. thanks a lot.



-ken zemaitis.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
if you're talking about ALL buttons
ken zemaitis
Ranch Hand

Joined: Sep 26, 2005
Posts: 42
Originally posted by Michael Dunn:
if you're talking about ALL buttons


for some reason when i inserted into my program, nothing changed. im not sure if there is something else i need to set up, however, i couldnt figure it out. :X
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
dis you add the UIManager line as the first line in main()?
ken zemaitis
Ranch Hand

Joined: Sep 26, 2005
Posts: 42
Originally posted by Michael Dunn:
dis you add the UIManager line as the first line in main()?


definitely not.
ken zemaitis
Ranch Hand

Joined: Sep 26, 2005
Posts: 42
Originally posted by ken zemaitis:


definitely not.


YIKES! i misread that, i did do that, and still the buttons look generic.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
works OK on 1.4.0_01, so the problem could be in your L & F.

in the constructor, add this for one of the buttons

additionButton.setContentAreaFilled(false);
additionButton.setOpaque(true);

recompile/run see if additionButton's background changes
ken zemaitis
Ranch Hand

Joined: Sep 26, 2005
Posts: 42
Originally posted by Michael Dunn:
works OK on 1.4.0_01, so the problem could be in your L & F.

in the constructor, add this for one of the buttons

additionButton.setContentAreaFilled(false);
additionButton.setOpaque(true);

recompile/run see if additionButton's background changes


holy sweet mother it works. i thought i had tried this before however obviously i must have screwed it up. you saved the day. thanks a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: button colors, etc.