When buttons are created they are often too wide for the text. The problem
is worse as text becomes longer. I want the same margin between border and
text for all buttons. Using style to adjust this value doesn't help. It
seems the button width is computed incorrectly, or by the wrong factor, for
the number of characters and font. Help would be appreciated. Thanks

Signature
NewsGuy.Com 30Gb $9.95 Carry Forward and On Demand Bandwidth
> When buttons are created they are often too wide for the text. The problem
> is worse as text becomes longer. I want the same margin between border and
> text for all buttons. Using style to adjust this value doesn't help. It
> seems the button width is computed incorrectly, or by the wrong factor, for
> the number of characters and font. Help would be appreciated. Thanks
Use layout managers.

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
> When buttons are created they are often too wide for the text. The problem
> is worse as text becomes longer. I want the same margin between border and
> text for all buttons. Using style to adjust this value doesn't help. It
> seems the button width is computed incorrectly, or by the wrong factor, for
> the number of characters and font. Help would be appreciated. Thanks
Default margin for button is
Button.margin
javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14]
It is your choice how and when to modify:
1. At startup for all buttons (Using UIManager)
2. At object creation for specific button
David McDivitt - 09 May 2006 16:28 GMT
>From: Vova Reznik <address@mail.com>
>Date: Tue, 09 May 2006 15:17:05 GMT
[quoted text clipped - 14 lines]
>1. At startup for all buttons (Using UIManager)
>2. At object creation for specific button
I should have been more specific. The button is in client-side HTML, not an
applet. It is a java struts application. I will find an HTML group and post
the question there, too.

Signature
NewsGuy.Com 30Gb $9.95 Carry Forward and On Demand Bandwidth
David McDivitt - 09 May 2006 17:34 GMT
>From: David McDivitt <x12code-del@del-yahoo.com>
>Date: Tue, 09 May 2006 10:28:47 -0500
[quoted text clipped - 21 lines]
>applet. It is a java struts application. I will find an HTML group and post
>the question there, too.
I was able to resolve this using a label and style sheet with inset and
outset. The label computes width correctly. Buttons do not.

Signature
NewsGuy.Com 30Gb $9.95 Carry Forward and On Demand Bandwidth