Mailing Lists: Apple Mailing Lists

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

Custom Component Focus Ring



Mike Swingler wrote:

Perhaps we should add one. :)
Using the focusable attribute might be a good hint too. I'm taking all
suggestions at this point.

While on the topic of focus rings, when creating a custom focusable component (e.g. by specializing JPanel), what is the best way to add a focus ring? Should I paint it myself in my component, create my own border class to paint it, or use an Aqua PLAF class? If I paint it myself, what colour should I use -- I can't find a UIDefaults value for the focus ring colour, nor is there a java.awt.SystemColor entry for it. And what is the best technique to get the "glow" effect -- draw multiple outlines (e.g. rect or round rect) with increasing size and transparency? Is there some funky trick in Java2D to get the right gradient with a single outline?


The last custom component I wrote I wound up refactoring to inherit from a component that already had a focus ring. That may not always be possible, or the best solution.
_______________________________________________
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


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.