• 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
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

JButton background colors all the sudden not setting.  RSS feed

 
Ranch Hand
Posts: 209
  • 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.
 
Nathan Milota
Ranch Hand
Posts: 209
  • 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
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!