Java Swing - How to make the JButton's boundaries invisible? -
In the screenshot below, you can see four buttons in the selected area. I want to duplicate this type of button in my GUI application. Each of these buttons has an image (play, stop, forward, rewind). I can use the icon's icon property to add to the image.
When the user catches the mouse pointer on a button, then there are three things:
- It varies color - I do not need this feature.
- This tool shows tips I know how to do this by using the tooltip text property of a button.
- Most importantly, These buttons do not have the border around them, their limitations are not visible at all. This is the image that is visible. I want to do something like that. But when I add an image to a button, its range does not go away (I mean that these boundaries are clearly visible in the form of a line - as you can see in the second image)
Then limit the limits of what a button's property should I manipulate, or what method should be used (and on this Except the existing image, marks of every view of the button) invisible?
< Img src = "https://i.stack.imgur.com/SnXEC.png" alt = "Enter image details here">
A border is painted when set to true, otherwise:
setBorderPainted
: < / P>
set
border painted
property. If there is a limit oftrue
and buttons, then the border is painted. The default value for property istrue
. Looking at something and feel that it can not support theborder-painted
property, in which case they ignore it.
Note that some glance and experience can ignore this property.
Update:
The default and experience is called CrossPlatformLookAndFeel
. It does not have a look and feel, but is an indicator of the default. The default that depends on the platform that you are using. Look for the details I was personally using Loka, but I had to face some problems with it. I'm not sure if it respects setBorderPainted
, but I would not be surprised that it is not.
Comments
Post a Comment