Creating custom JButton from images containing transparent pixels
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 alpha parameter. So far, overriding the paint() method to draw the image has worked in the sense that the button is drawn showing the correct image. I'd like to improve it, though, by making its shape (clickable area) the same as the visible pixels on the image (right now if I draw the button's border, it's a square). Is there an easy way to do that or do I have to parse the image and find the alpha pixels to make a custom border? Which