public void mouseReleased(MouseEvent e) {

      updateOverTab(e.getX(), e.getY());

      if (overTabIndex == -1) {
        if (e.isPopupTrigger()) ((CloseAndMaxTabbedPane) tabPane).firePopupOutsideTabEvent(e);
        return;
      }

      if (isOneActionButtonEnabled() && e.isPopupTrigger()) {
        super.mousePressed(e);

        closeIndexStatus = INACTIVE; // Prevent undesired action when
        maxIndexStatus = INACTIVE; // right-clicking on icons

        actionPopupMenu.show(tabScroller.tabPanel, e.getX(), e.getY());
        return;
      }

      if (closeIndexStatus == PRESSED) {
        closeIndexStatus = OVER;
        tabScroller.tabPanel.repaint();
        ((CloseAndMaxTabbedPane) tabPane).fireCloseTabEvent(e, overTabIndex);
        return;
      }

      if (maxIndexStatus == PRESSED) {
        maxIndexStatus = OVER;
        tabScroller.tabPanel.repaint();
        ((CloseAndMaxTabbedPane) tabPane).fireMaxTabEvent(e, overTabIndex);
        return;
      }
    }
 public void mouseClicked(MouseEvent e) {
   super.mousePressed(e);
   if (e.getClickCount() > 1 && overTabIndex != -1) {
     ((CloseAndMaxTabbedPane) tabPane).fireDoubleClickTabEvent(e, overTabIndex);
   }
 }