I know this question has been asked a million times, and can be done by overriding paintComponent()
, but what I want to know is how to change the shape while respecting the current Look And Feel. If I want to change the shape to a circle, I also want the button to look like a button, just with a different shape.
I tried making a JButton, the overriding paintComponent
, then clipping it to a circle, but I didn't get the border effects on Nimbus LAF
.
Is there a better way? Or is there a method in JButton
?
PieceButton
has a roundIcon
that may get you started on your sscce. – GaultieroLAF
??? – Afterburner