@Override
        public void mousePressed(MouseEvent e) {
            if (!tabPane.isEnabled()) {
                return;
            }

            tabPressed = tabForCoordinate(tabPane, e.getX(), e.getY());
            if (tabPressed != -1) {
                tabPane.repaint(getTabBounds(tabPane, tabPressed));
            }
        }