【问题标题】:How to remove the box surrounding the text inside a JButton?如何删除 JButton 内文本周围的框? 【发布时间】:2019-10-27 19:06:52 【问题描述】: this image shows the box 当我运行JFrame 时,一个小框围绕着焦点JButton 中的文本(见附图) 我怎样才能去掉那个盒子? 【问题讨论】: 用户应该如何知道哪个按钮被聚焦?另见How to create great screenshots? 标签: java swing focus jbutton 【解决方案1】: 此属性称为focusPainted,您可以通过以下方式禁用它: jbutton.setFocusPainted(false); 【讨论】: