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.
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.
First, set your look and feel to something cool, like 'metal'.
Then do something like this:
If the color of your button is exactly equals to swing control color (240,240,240), windows will apply windows-like button style to the button, otherwise, the button assumes a simple flat style.
You may want to use a JLabel with a MouseListener instead... unless you're tied to using a JButton or ActionListener in some way.
Just set the colours and the border:
Use
setOpaque(false);
to make the background transparent.How about
?
I don't know if I have missed a point... But I usually do somtehing like this: