Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JMenuBar showing gradient background on Mac -- how to disable?

 
Michael Martin
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JMenuBar on Mac OS adds a gradient, which I don't want. See the simple example below. (Note, the gradient is very subtle. Using Mac OS's DigitalColorMeter utility, you can detect it.) Does anyone know how I can get rid of it. No matter what I set the background color to, it adds this subtle gradient on top of it. UIManager.get("MenuBar.gradient") returns null. Any ideas?

 
Rob Camick
Ranch Hand
Posts: 2580
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be Forthright When Cross Posting To Other Sites

Also posted in the Sun forums.
 
Michael Martin
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(Busted. Sorry, I'll be sure to say when I'm posting to more than one forum in the future.) I think the below example makes the issue a little clearer. If you add the JMenuBar to a JPanel, instead of using setJMenuBar on the JFrame, you can see the gradient clearer. Notice the top of the JMenuBar is lighter than the bottom. Is there a way to disable that? Thanks.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic