public Rectangle getSelectionRect() { if (selectedRows_.size() == 0) return null; sortSelectedRows(); TableRowElement first = selectedRows_.get(0); TableRowElement last = selectedRows_.get(selectedRows_.size() - 1); int top = first.getOffsetTop(); int bottom = last.getOffsetTop() + last.getOffsetHeight(); int left = first.getOffsetLeft(); int width = first.getOffsetWidth(); return new Rectangle(left, top, width, bottom - top); }