如何制作简单平面风格的JButton?
问题描述:
最简单的方法是让JButton只显示背景颜色?我不需要任何其他效果,如边框,3D外观或悬停突出显示。
whats the most simple way to make a JButton only show the background color? I don't need any other effects like borders, 3D-look or hover-highlighting.
提前致谢。
答
我不知道我是否错过了一个点...
但我通常会这样做:
I don't know if I have missed a point... But I usually do somtehing like this:
button.setBorderPainted(false);
button.setFocusPainted(false);
button.setContentAreaFilled(false);