code: protected Rectangle getCloseButtonBounds(int tabIndex) {
          Rectangle bounds = new Rectangle(rects[tabIndex]);
  
          bounds.width  = closeButtonSize;
          bounds.height = closeButtonSize;
  
          bounds.y += (rects[tabIndex].height - closeButtonSize - closeButtonInsets.top - closeButtonInsets.bottom) / 2
              + closeButtonInsets.top;
  
          boolean onLeft = isCloseButtonOnLeft();
  
          if (onLeft) {
              int offset = orientation == ControlOrientation.VERTICAL || tabIndex == 0 ? 6 : 3;
  
              bounds.x += offset;
          } else {
              int offset = orientation == ControlOrientation.VERTICAL || tabIndex == tabPane.getTabCount() - 1 ? 6 : 4;
  
              bounds.x += rects[tabIndex].width - bounds.width - offset;
          }
  
          return bounds;
      }
docs: Get the bounds for a tab close button.
  
  @param  tabIndex the tab index.
  
  @return the bounds.