if (showingResizeCursor && e.getSource() != frame) { frame.setCursor(Cursor.getDefaultCursor()); showingResizeCursor = false; } else if (e.getSource()==frame && frame.isResizable()) { int cursor; switch (sectionOfClick(e.getX(), e.getY())) { case NORTH: cursor = Cursor.N_RESIZE_CURSOR; break; case NORTH_EAST: cursor = Cursor.NE_RESIZE_CURSOR; break; case EAST: cursor = Cursor.E_RESIZE_CURSOR; break; case SOUTH_EAST: cursor = Cursor.SE_RESIZE_CURSOR; break; case SOUTH: cursor = Cursor.S_RESIZE_CURSOR; break; case SOUTH_WEST: cursor = Cursor.SW_RESIZE_CURSOR; break; case WEST: cursor = Cursor.W_RESIZE_CURSOR; break; case NORTH_WEST: cursor = Cursor.NW_RESIZE_CURSOR; break; default: cursor = Cursor.DEFAULT_CURSOR; }  Cursor resize = Cursor.getPredefinedCursor(cursor); frame.setCursor(resize); showingResizeCursor = true; }
    public void mouseMoved(MouseEvent e)    {      // There is nothing to do when the mouse moves      // over the border area.    }