if (x < insets.left && y < insets.top) return NORTH_WEST; else if (x > b.width - insets.right && y < insets.top) return NORTH_EAST; else if (x > b.width - insets.right && y > b.height - insets.bottom) return SOUTH_EAST; else if (x < insets.left && y > b.height - insets.bottom) return SOUTH_WEST; else if (y < insets.top) return NORTH; else if (x < insets.left) return WEST; else if (y > b.height - insets.bottom) return SOUTH; else if (x > b.width - insets.right) return EAST;
int corner = InternalFrameBorder.cornerSize;  if (x < corner && y < corner) return Cursor.NW_RESIZE_CURSOR; else if (x > b.width - corner && y < corner) return Cursor.NE_RESIZE_CURSOR; else if (x > b.width - corner && y > b.height - corner) return Cursor.SE_RESIZE_CURSOR; else if (x < corner && y > b.height - corner) return Cursor.SW_RESIZE_CURSOR; else if (y < corner) return Cursor.N_RESIZE_CURSOR; else if (x < corner) return Cursor.W_RESIZE_CURSOR; else if (y > b.height - corner) return Cursor.S_RESIZE_CURSOR; else if (x > b.width - corner) return Cursor.E_RESIZE_CURSOR;
    private int sectionOfClick(int x, int y)    {      Insets insets = frame.getInsets();      Rectangle b = frame.getBounds();      if (x < insets.left && y < insets.top)        return NORTH_WEST;      else if (x > b.width - insets.right && y < insets.top)        return NORTH_EAST;      else if (x > b.width - insets.right && y > b.height - insets.bottom)        return SOUTH_EAST;      else if (x < insets.left && y > b.height - insets.bottom)        return SOUTH_WEST;      else if (y < insets.top)        return NORTH;      else if (x < insets.left)        return WEST;      else if (y > b.height - insets.bottom)        return SOUTH;      else if (x > b.width - insets.right)        return EAST;      return -1;    }