Rectangle (int first, int last) { Rectangle firstRect = getCellRect(first, 0, true); Rectangle lastRect = getCellRect(last, 0, true); return new Rectangle(firstRect.x, firstRect.y, lastRect.width, lastRect.y + lastRect.height - firstRect.y); }