Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • 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
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

JButton background colors all the sudden not setting.  RSS feed

 
Ranch Hand
Posts: 170
  • 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: 965
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.
 
Kenneth Milota
Ranch Hand
Posts: 170
  • 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
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!