Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

JButton background colors all the sudden not setting.  RSS feed

 
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a program where I let users choose a standard or colorful option for the scheme, and all of the sudden without any reason why, the background colors are just showing up on the perimeter of the button, but staying gray inside.  

All I did was copied and pasted a my methods from Eclipse over to NetBeans, because the licensing libraries I use only work on NetBeans, but it is 100% the exact same code, but it will not show the button colors.  I don't understand why.  

Here are 2 photos.  The one with the gray buttons is the malfunctioning one.
Home-Screen.png
[Thumbnail for Home-Screen.png]
front-screen.png
[Thumbnail for front-screen.png]
 
Author
Posts: 974
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried experimenting with myButton.setContentAreaFilled(true) yet?
It may be that Netbeans is using a different look and feel, or something like that, which is setting this property differently.
 
Nathan Milota
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There was some kind of set look and feel line of code needed when using NetBeans
 
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!