Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mac OS X makes my JLayeredPanes Pink.

 
Ted Reynolds
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written an application that uses JLayeredPanes to paint the background texture on all my dialogs and such. This works great on Windows and Unix, but when I run it on Mac OS X they all have a pink color to them. Can anyone tell me why and how to change it so the pink caste goes away.
Here's and example of one of my dialogs:
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure why your JLayeredPane is pinkish on OS X... maybe it's just that color in the Mac look and feel. Take a look at the UIManager class for the methods you need to check the current look and feel, use a different look and feel, or bind a different color to be a components "default".

From just the code you've shown me, there's not a lot of a reason to use a JLayeredPane... you only need to use a JLayeredPane if you want to add components on top of each other. If you just need to paint something in the background you can just use a regular old JPanel.
 
Ted Reynolds
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the information. I'll check with someone I know (now) at apple on the pink thing. I have tried to use JPanels to paint the background and could not get them to work properly, either only the buttons would display or the image I wanted in the background would display with the buttons showing up only after I hovered over their position with the mouse. whereas the JLayeredPanes I could get to work. Anyway thanks for the info.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic