| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
The "square" client property is different than the square style that buttons become when they are shrunk too small. If you reduce the button's vertical height by enough, it will turn from a rounded style to the square style, with no space for the focus ring.
Currently, if you setOpaque(true) on the JTextField, it will also remove the space allocated for the focus ring.
You may want to try using one of the other buttons styles that are more lightweight than a standard push button, and won't need to physically abut the textfield, like "roundRect". Another option may be a "small" style "textured" button.
All of these issues pretty clearly cry out for a "JComponent.includeFocusRing" style client property to dictate if the focus ring should be clipped or not (since you may have already have setFocusable(false), and the padding is not needed). But this is only one possible solution.
Generally speaking, pushing controls up against each other doesn't work very well in Aqua. The Aqua Human Interface Guidelines expound at much length how large regions of whitespace are more useful to the user to visually group controls, and you might be trying to composite two controls together to form a whole different kind of control (I'm assuming this probably some kind of path or class picker?). If we know a little more about what these controls are doing, we might be able to offer a more creative solution for you in Aqua, that will still degrade nicely to "just a button" in other Look and Feels.
Please file a bug report with a test case that brings up the layout you are looking for using, say Metal or the Aqua from Tiger, and what the overall component group is trying to accomplish.
Thanks,
Mike Swingler
Java Frameworks Engineer
Apple Inc.
On Nov 21, 2007, at 6:11 AM, Ken Orr wrote:
Hey Bill,
I'll file a bug against this. Also, I noticed (and I think you did too), that there is no way to get rid of the focus border in the calculations of the button's size, at least for some button types, namely the 'squre' type. I can make the focus ring not draw, but the button still has a padding around it that I don't want. By the way, this is when I'm using the 'square' button type, which can property expand and contract.
<image.jpg>
Notice the nasty padding around the button.
-Ken
On 11/21/07 8:15 AM, "Bill Tschumy" <email@hidden> wrote:
> That looks like the same issue I wrote about earlier this week in my
> "Problem with button margins in Leopard" posting. I haven't submitted
> a bug yet, but I plan to in the next few days. If both of us do it
> should get twice the attention, right?
>
> I was kind of hoping one of the Apple Swing engineers would chime in
> and explain it.
>
> Bill
>
>
> On Nov 21, 2007, at 6:30 AM, Ken Orr wrote:
>
>> Has anyone already created a bug against the incorrect centering of
>> an icon in a button?
>>
>> <image.jpg>
>> _______________________________________________
>> 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
_______________________________________________ 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: | |
| >Re: Toolbar button offset (From: Mike Swingler <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.