/** * AWT event listener. Used to reset the mouse cursor when divider was changed and mouse exited * event had not occurred normally. * * @param event */ public void eventDispatched(AWTEvent event) { if (event.getID() == MouseEvent.MOUSE_MOVED || event.getID() == MouseEvent.MOUSE_RELEASED) { MouseEvent mev = (MouseEvent) event; if (mev.getSource() != Handler.this.container && withinBounds) { if (mev.getSource() instanceof GlassedPane.GlassPane) { // on glass pane -> check with traditional method // Question by Beni: does this ever happen? checkMousePositionAsync(); } else { // mouse is over another component which is not the registered container and the mouse // cursor had not been reseted yet -> reset mouse cursor Point p = SwingUtilities.convertPoint(mev.getComponent(), mev.getPoint(), station); if (station.getBounds().contains(p)) { // only if mouse is within our station setCursor(null); withinBounds = false; } } } } }