This code is in my mouseDragged function and it drags the undecorated JFrame
if (mouse.y < 25 && !closePol.contains(mouse)){
getParent().getParent().getParent().getParent().setLocation(new Point(e.getXOnScreen() - mouse.x, e.getYOnScreen() - mouse.y));
}
and I have code that sets mouse = new Point()
whenever I move the mouse out of the JFrame.
It works fine but there is a bug. Whenever I start dragging with mouse.y >= 25
and drag out the window, this happens. The window moves the top left corner to the mouse.