@Override
  protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) {
    final Rectangle iconRect = new Rectangle();
    final Rectangle textRect = new Rectangle();
    final int tabCount = tabPane.getTabCount();

    // Paint tabRuns of tabs from back to front
    for (int i = runCount - 1; i >= 0; i--) {
      final int start = tabRuns[i];
      final int next = tabRuns[(i == runCount - 1) ? 0 : i + 1];
      final int end = (next != 0 ? next - 1 : tabCount - 1);
      for (int j = end; j >= start; j--) {
        if (j != selectedIndex) {
          paintTab(g, rects, j, iconRect, textRect);
        }
      }
    }
    // Always paint selected tab last, as it overlaps the others.
    if (selectedIndex >= 0) {
      paintTab(g, rects, selectedIndex, iconRect, textRect);
    }
  }
A tabbed layout that applies a small overlap to the tabs.
java/ui/src/main/java/com/google/security/zynamics/bindiff/gui/components/MaterialChromeTabbedPaneUI.java