Buttons of Irregular ShapeIn previous post, I have demonstrated how to detect mouse click in a triangular region. That made implementation of a triangular button possible. In this post I will move one step forward. I am going to implement a button with arbitrary shape.
Transparent ImageFirst you will need a transparent image file to act as the button. It is not difficult to make one yourself. I have prepared one for you:
Download it and save it as "a.png". Place it at the same folder as ImageButton.java.