{
DesktopManager dm = getDesktopManager();
xOffset = 0;
yOffset = 0;
if (e.getSource() == frame && frame.isResizable())
dm.endResizingFrame(frame);
else if (e.getSource() == titlePane)
{
dm.endDraggingFrame(frame);
frame.putClientProperty("bufferedDragging", null);
}