Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我向 JPanel 添加了几个 JButton,并为 JPanel 添加了 setOpaque(false)。当我将鼠标移到JButton上时,按钮下方出现一个正方形,然后很快消失,这让我感觉很糟糕。有谁知道出了什么问题?(对不起我的英语不好)
如 JComponent javadoc 中所述,False 是 setOpaque 的默认值。
这与它在屏幕上绘制组件所做的努力有关,当该属性设置为 true 时,组件的所有像素都将绘制在屏幕上。