drawBounds(frame);
moveFrame(frame, dragBounds.x + dragBounds.width / 2, dragBounds.y + dragBounds.height / 2);
}
public void moveFrame(JComponent frame, int newX, int newY) {
JDesktopPane desktop = getDesktopPane(frame);
LayoutManager2 layoutManager = (LayoutManager2)desktop.getLayout();
Component componentToDock = desktop.getComponentAt(newX, newY);
if (componentToDock != null && componentToDock != frame) {
layoutManager.addLayoutComponent(frame, new DockConstraints(componentToDock, getDockLocation(componentToDock, newX, newY)));
layoutManager.layoutContainer(desktop);
}
if (frame instanceof JInternalFrame) {