Howto make JButton with simple flat style?

c0d3x picture c0d3x · Dec 3, 2009 · Viewed 56.6k times · Source

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.

Thanks in advance.

Answer

André Luiz Clinio picture André Luiz Clinio · Jan 21, 2013

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);