This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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:
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.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Joined: Mar 16, 2004
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.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com