I am trying to create a button that has a custom shape (hexagon), but otherwise acts like a normal JButton would (that is, works with an ActionListener).
I have crea
You will have to extend JButton
class not AbstractButton
. Try the following things and you will get idea.
The first move is to subclass JButton
.
Then, in your subclass, start by redefining the paintComponent(Graphics)
method. If you want any changes.
Then, override paintBorder(Graphics)
to give it a shape of hexagon.