I set my JButton with this properties:
– borderPainted to false
– contentAreaFilled to false
– border to null
– opaque to false
and after click on the button, the background turns black or fades to black color,
but why,.. any suggestions!? (thx)
If you want to create a transparent button you need only to
setContentAreaFilled(false), do not callsetOpaque, see the javadoc (Just note that the last line in the javadoc suggests that varies by Look and Feel,.):If you "just want" text (and no border) you can call
setBorder(null).Example:
…with no border and no background (and no "pressed" background). Tested on default look and feel for unity/ubuntu e.g
MetalLookAndFeel.