void (Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { if (isSelected && tabStyle == TabStyle.underline) { boolean wrap = tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT; switch (tabPlacement) { case LEFT -> { int offset = SELECTION_HEIGHT.get() - (wrap ? getOffset() : 0); paintUnderline(g, x + w - offset, y, SELECTION_HEIGHT.get(), h); } case RIGHT -> { int offset = wrap ? getOffset() : 0; paintUnderline(g, x - offset, y, SELECTION_HEIGHT.get(), h); } case BOTTOM -> { int offset = wrap ? getOffset() : 0; paintUnderline(g, x, y - offset, w, SELECTION_HEIGHT.get()); } //case TOP, default -> { int offset = SELECTION_HEIGHT.get() - (wrap ? getOffset() : 0); paintUnderline(g, x, y + h - offset, w, SELECTION_HEIGHT.get()); } } } }