• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

button colors, etc.

 
ken zemaitis
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you're talking about ALL buttons
 
ken zemaitis
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dis you add the UIManager line as the first line in main()?
 
ken zemaitis
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Dunn:
dis you add the UIManager line as the first line in main()?


definitely not.
 
ken zemaitis
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic