Monday, September 8, 2008

State of clientProperty in OS X Java 1.6

Started looking at my pet Java Swing application - jSpent. This time the attempt was to create a leopard-like unified toolbar. I was so excited to see that there is a clientProperty "apple.awt.brushMetalLook" - By setting this as : 
myFrame.getRootPane().putClientProperty("apple.awt.brushMetalLook", Boolean.TRUE);
This will cause OS X to render the title bar in the unified style. But unfortunately, there is no good clientProperty setting for the toolbar itself. So we end up with a light gray window title bar. The toolbar appears like a gray box, painted in different color. Not sure if this is a bug in Apples Java. However, I had to again resort to pick and choose and paint my own gradient just below the window title bar to make it look "Unified". So, here is the output. 


But oh well, I need to repaint the toolbar in ligher gradient when the window goes out of focus.. hm.. that's too much to do!

No comments: