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: Eliminating focus ring space on Leopard & Java 1.5



I must admit I always get medieval on them:

	button.setUI(new BasicButtonUI());



On 29 Oct 2007, at 20:17, Steve Roy wrote:

Hey!

I have buttons that I don't want to ever get focus (in a toolbar) so I setFocusable(false), but while this does make them non-focusable, the space used by the focus ring is still there. Is there a way to eliminate this space?

Usually I would just set a compound border made up of a negative empty border and the original border:

button.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createEmptyBorder(-3, -3, -3, -3), button.getBorder()));


But this trick doesn't work with these new borders. Somehow they just don't draw anything at all when subverted this way.

I don't see any new client property to control the focus ring or focus ring space either.

At this point I could put the border inside a container with a negative empty border, but that's uglier than I would like it to be.

Do you guys know of anything I might have missed?

(By the way, I'm using the client property JButton.buttonType = square.)

Steve

--
Steve Roy
<http://homepage.mac.com/sroy>
_______________________________________________
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

_______________________________________________ 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: 
 >Eliminating focus ring space on Leopard & Java 1.5 (From: Steve Roy <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.