
Signature
Kenneth P. Turvey <kt-usenet@squeakydolphin.com>
> I'm trying to convince Java to create a button that is exactly the same
> size as the image that I'm using for it. I've set the Insets to (0, 0,
[quoted text clipped - 7 lines]
>
> Thanks,
I would imagine that the decorations on a JButton are very look and feel
dependent. If you really need it to be a certain size, write your own.
It is not that hard.
Why do you want it to be a specific size?

Signature
Knute Johnson
email s/knute/nospam/
Kenneth P. Turvey - 21 May 2008 04:05 GMT
> I would imagine that the decorations on a JButton are very look and feel
> dependent. If you really need it to be a certain size, write your own.
> It is not that hard.
>
> Why do you want it to be a specific size?
The customer specified how it would look by giving images for normal,
over, and selected. There are a number of buttons and the only way to
get them to all look the way the customer specified, and to layout the
way the customer specified is to make them the size the customer
specified.
This isn't really "the Java way", but that's the way I'm doing it. In
addition, I may be using an absolute layout for the toolbar since I just
can't get it to be perfect without one.

Signature
Kenneth P. Turvey <kt-usenet@squeakydolphin.com>
Kenneth P. Turvey - 21 May 2008 04:32 GMT
> I would imagine that the decorations on a JButton are very look and feel
> dependent. If you really need it to be a certain size, write your own.
> It is not that hard.
>
> Why do you want it to be a specific size?
After starting to write my own, then realizing that I will need one class
for regular buttons and another for toggle buttons and that the
complexity, although not high, is higher than I was ready to invest time
in, I realized that I can achieve what I want by simply setting the
border to null. I know this isn't the recommended way of handling
borders in swing, but I couldn't think of a situation where this would be
a problem.

Signature
Kenneth P. Turvey <kt-usenet@squeakydolphin.com>
Knute Johnson - 21 May 2008 05:21 GMT
>> I would imagine that the decorations on a JButton are very look and feel
>> dependent. If you really need it to be a certain size, write your own.
[quoted text clipped - 9 lines]
> borders in swing, but I couldn't think of a situation where this would be
> a problem.
I don't know, sounds like it solves your problem.

Signature
Knute Johnson
email s/knute/nospam/
Hi,
> Any hints would be appreciated.
Assuming you are using a Swing-Button (JButton), #setMargin and
eventually #setBorderPainted shall do the trick.
Regards,
Paul