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

JButton is not displaying the background color

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All, I have a JButton that pops up the color chooser on click and changes its background color when a new color is selected. This works fine unless I change the LookAndFeel of the dialog containing the button as follows.

UIManager.setLookAndFeel(new WindowsLookAndFeel());

When the LookAndFeel is set, it appears like the button is on a panel, and the panel is changing its background color. I understand that on WindowsLookAndFeel a gradient is drawn on top of the button to display that 3D look which is why the background color is not being shown. Just wondering if there is a work around for this.
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look on this page down toward the bottom under the heading "Potential Incompatibilities" at (the first) paragraph number 4607364.
 
Dalia Sultana
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great! That helped thanks!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!