Java – how to clear the border around the button?
•
Java
I have a JPanel with GridLayout I have a button in each cell of the grid I see that each button is surrounded by a gray border I want to delete these borders Does anyone know how to do it
Solution
Border emptyBorder = BorderFactory.createEmptyBorder();
Border emptyBorder = BorderFactory.createEmptyBorder(); yourButton.setBorder(emptyBorder);
For more details about boundaries, see borderfactory
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码