• 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

button colors, etc.

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if you're talking about ALL buttons
 
ken zemaitis
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic