Hello,
I'm playing a bit with JButton aspect.
I've seen several beautiful buttons in some java L&F and am trying to
subclass only the JButton class in order to keep my original L&F but
only have SOME buttons with a different "style".
I'm basically trying to achieve the appearance of a clean 3D button
(using gradients on the sides and on the top of the button). that works
OK by modifying the "paintComponent" method.
however I'm left with the same ugly "windows style" button borders:
light gray on top and left borders, dark gray on bottom and right
borders (the ones used by the basic "windows" L&F).
I'd like to get rid of those and have a simple border (or no border at
all for that matter), but I can't find WHERE this graphic element is
set in the Java source. I've looked in JButton paintComponent, in the
ButtonUI "update" method, but I can't identify the code...
could anyone point me in the right direction ?
thanks for your help !
Michael Dunn - 08 Sep 2005 03:46 GMT
> (or no border at all for that matter)
button.setBorderPainted(false);
or
button.setBorder(null);
antoine - 08 Sep 2005 05:40 GMT
great, just had to add a this.setBorder(Metal.getButtonBorders()) in my
custom button constructor
thanks for the pointer !