Rectangle (int index) { Rectangle bounds = getCellBounds(index, index); Rectangle visibleRect = getVisibleRect(); visibleRect.setSize(visibleRect.width - getInsets().right, visibleRect.height); bounds = bounds.intersection(visibleRect); Icon icon = toSize(getIcon()); return new Rectangle(((int) bounds.getMaxX()) - icon.getIconWidth(), bounds.y + (bounds.height - icon.getIconHeight()) / 2, icon.getIconWidth(), icon.getIconHeight()); }