Reputation: 9020
In the screenshot below, you can see four buttons in the selected area. I want to mimic this kind of buttons in my GUI application. Each of these buttons has an image on them (play,stop, forward, rewind). I can use the icon property of the button to add an image to it.
When the user hovers the mouse pointer over a button, three things happen:
So what property of an button should I manipulate, or what method should I use, to make its borders (and every visible trace of the button except the image present on it) invisible?
Upvotes: 0
Views: 1025
Reputation: 18364
A border is painted when setBorderPainted
is set to true, otherwise not:
setBorderPainted
:
Sets the
borderPainted
property. Iftrue
and the button has a border, the border is painted. The default value for theborderPainted
property istrue
. Some look and feels might not support theborderPainted
property, in which case they ignore this.
Note that some look and feels may ignore this property.
Update:
The default look and feel is called CrossPlatformLookAndFeel
. This is not a look and feel but an indicator of the default one. What you get as default depends on the platform you are using. See How to Set the Look and Feel for details. I personally loke the Nimbus Look and Feel, but I have encountered some problems with it. I am not sure if it respects setBorderPainted
, but I will not be surprised if it does not.
Upvotes: 4