سؤال

I have a custom component displaying *.png image. The image has transparent and non-transparent area. If I add ActionListener(or MouseClickListener) to component, it will raise events even if I click on transparent area of component. Visually it looks like clicking outside the component. How can I declare which area should react on clicks and which should not?

I've read about getting pixel from image your coordinates from event object and check its transparency. It seems difficult and ineffective.

Maybe define custom-border of this component or something else?

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top