Read edit 2 for what I\'m actually missing to make it work
I\'m currently trying to create some custom JButtons using images created in photoshop that have an
If you want your button layout to be that of the non-transparent pixels in your image, then you should redefine the paintComponent()
method. It is the most correct way of doing it (overriding paint() worked in old times but is now discouraged).
However I think it is not exactly what you want: you want a click on the button to be detected only if it is on a non-transparent pixel, right? In that case you have to parse your image and when clicked compare mouse coordinates to the pixel alpha channel of your image as JButton does not have such a feature.