Rectangle () { final int selectedRow = myComponent.getSelectedRow(); if(selectedRow < 0 || selectedRow >= myComponent.getRowCount()){ return null; } final Rectangle rowRect = myComponent.getCellRect(selectedRow, 0, true); final Rectangle visibleRect = myComponent.getVisibleRect(); if(visibleRect.intersects(rowRect)){ return visibleRect.intersection(rowRect); } else{ return null; } }