MouseEvents are sent to the topmost (in z-order) component that is enabled for them, that has a mouse pointer registered on it, or has internally configured eventMask to handle them. Although, as a rule, JLabel is transparent (and, therefore, the events should reach the base panel), they can get the opacity of the fi event setting a tooltip.
In jdk 7, you can use JLayer to get all (mouse) events delivered to its children. The JLayer
documentation says:
JLayer is a good solution if you only need to do the usual coloring of the composite component or catch input events from your subcomponents .
The predecessor for jdk6 is the JXLayer project in SwingLabs. Another option is to use AWTEventListener as described in Rob blog (be careful: not allowed in context with security restrictions)
source share