Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Disabling drop shadow on JWindows?




On 10-Jul-05, at 3:13 AM, Tim Boudreau wrote:

I just wrote a patch for NetBeans which provides MS-Office style tooltips in lists and trees, if there is not enough space for the entire cell to be displayed - so moving the mouse over any not- fully-displayed items shows a popup that for all intents and purposes looks as if it's extending out the side of the tree or list - it's supposed to look seamless.

As is predictable, I'm using javax.swing.PopupFactory to create the popups. There is just one problem, but it makes the results a bit unattractive on mac-os: Sometimes, if the popup is a heavyweight window, it has a drop shadow (including a small right border dividing it from the rest of the component. It's compounded a bit by the fact that Apple's implementation of PopupFactory doesn't seem to get the algorithm for deciding when to use a heavyweight window quite right - sometimes, apparently randomly, it will use a heavyweight window even though a lightweight popup would work just fine.

I could write a workaround by providing my own PopupFactory implementation, if I knew a way to turn off the drop-shadow for the heavyweight popup window that would sometimes legitimately be needed. Anybody know a way to do it (dirty hacks are acceptable)?

In 'Swing Hacks' (O'Reilly) there is an example of adding custom drop- shadows to menus (Ch 1, Hack 11). Perhaps, by using the custom-code, you could switch-off the effect and get what you want. Looking at the sample code; PopupFactory isn't used. The book's worth looking at :-)


Swing Hacks example code
http://examples.oreilly.com/swinghks/

Swing Hacks book
http://www.oreilly.com/catalog/swinghks/

Swing Hacks code re-use policy
http://www.oreilly.com/pub/a/oreilly/ask_tim/2001/codepolicy.html


Rob

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Disabling drop shadow on JWindows? (From: Tim Boudreau <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.