是否可以将 JButton 的形状从矩形更改为圆形?
最佳答案
Sean Cogan 提供的链接就是您所需要的。如果您想要简而言之,请设置一个图像(圆形或任何您希望按钮看起来相似的形状)
使用 setIcon
然后在 JButton (button1) 上设置这些值 -
button1.setContentAreaFilled(false);
button1.setFocusPainted(false);
button1.setBorderPainted(false);
关于java - 可以改变 JButton 的形状吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11742502/