When adding a MouseListener to a JToolBar,
jToolbar.addMouseListener(new MouseInputAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
log.debug(e.getPoint());
}
});
The event only fires when clicked outside the JToolBar's gripper.
If I override BasicToolBarUI's createDockingListener():
@Override
protected MouseInputListener createDockingListener() {
return new MouseInputAdapter() {
@Override
public void mousePressed(MouseEvent evt) {
log.debug(e.getPoint());
}
}
}
The event will fire when clicked on the gripper.
So my question is, why? Is the MouseEvent consumed in the dockingListener? But I don't see any code that consumes the event.