I want to do a JButton
with PNG icon but the clickable area have to be a pixel and not a transparency pixel, and position this JButton
over oth开发者_开发知识库er JButton
s like position absolute in css.
thanks in advance
Create a JLabel with the imge and add a MouseListener. In the listener check Point of the MouseEvent. Get pixel from the image for the point and check alpha of the image's point color. If it's not transparent do your action.
精彩评论