void () { PointerInfo info = MouseInfo.getPointerInfo(); if (info != null) { Point eventPoint = new Point(info.getLocation()); for (Window window : Window.getWindows()) { if (window.getMousePosition() != null) { SwingUtilities.convertPointFromScreen(eventPoint, window); Component eventSource = SwingUtilities.getDeepestComponentAt(window, eventPoint.x, eventPoint.y); painter.repaint(eventSource, SwingUtilities.convertPoint(window, eventPoint, eventSource)); return; } } } painter.removePainter(); }