Class RedispatchingMouseAdapter

java.lang.Object
ca.corbett.extras.RedispatchingMouseAdapter
All Implemented Interfaces:
MouseListener, MouseMotionListener, MouseWheelListener, EventListener

public class RedispatchingMouseAdapter extends Object implements MouseListener, MouseWheelListener, MouseMotionListener
Sometimes you want mouse events that arrive on a child component to bubble up to the containing component to be processed there. For example, you have a JLabel sitting inside a JPanel, but when a mouse event happens on the JLabel, you want the JPanel to receive it instead. So, we need a way to propagate the mouse events up to the parent. I found this solution on StackOverflow and it seems to work really well. All credit goes to user Wojciech Wirzbicki and his answer from 2015.
Since:
2017-11-12