如何去除边框按钮? [英] How to remove border around buttons?
本文介绍了如何去除边框按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我与GridLayout的一个JPanel。在网格的每一个细胞我有一个按钮。我看到,每一个按钮被灰色的边框包围。我想删除这些边界。有谁知道它是如何做呢?
解决方案
边境emptyBorder = BorderFactory.createEmptyBorder();
yourButton.setBorder(emptyBorder);
有关边界的详细信息,请参阅 BorderFactory
I have a JPanel with the GridLayout. In every cell of the grid I have a button. I see that every button is surrounded by a gray border. I would like to remove these borders. Does anybody know how it can be done?
解决方案
Border emptyBorder = BorderFactory.createEmptyBorder();
yourButton.setBorder(emptyBorder);
For more details on borders see the BorderFactory
这篇关于如何去除边框按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文