void (Graphics g) { super.paint(g); boolean isSelectedUnderMouse = false; Point mousePoint = mouseTracker.getMousePoint(); if (mousePoint != null) { int index = locationToIndex(mousePoint); if (index != -1 && canOpenInSplitter(getModel().getElementAt(index))) { isSelectedUnderMouse = getSelectedIndex() == index; final Rectangle iconRect = getIconRectangle(index); boolean isIconHover = iconRect.contains(mousePoint); Icon icon = getIcon(); if (isSelectedUnderMouse) { icon = IconLoader.getDarkIcon(icon, true); } if (!isIconHover && !isSelectedUnderMouse) { icon = IconLoader.getTransparentIcon(icon); } icon = toSize(icon); icon.paintIcon(this, g, iconRect.x, iconRect.y); } } int index = getSelectedIndex(); if (index != -1 && !isSelectedUnderMouse && canOpenInSplitter(getModel().getElementAt(index))) { final Rectangle iconRect = getIconRectangle(index); Icon icon = getIcon(); icon = IconLoader.getDarkIcon(icon, true); icon = toSize(icon); icon.paintIcon(this, g, iconRect.x, iconRect.y); } }