Beispiel #1
0
 /*
  * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
  */
 public void mouseClicked(MouseEvent me) {
   int tab = results.getSelectedIndex();
   if (tab != -1) {
     Rectangle tabBounds = results.getBoundsAt(tab);
     if (!tabBounds.contains(me.getX(), me.getY())) {
       return;
     }
     if (tab >= 1 && me.getClickCount() >= 2) {
       myDoubleClick(tab - 1); // help tab is 0
     }
   }
 }
 /*
  * if(the mouse click is not in the bounds of the tabbed panel)
  *      then call mySingleClick() or myDoubleClick().
  *
  * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
  */
 public void mouseClicked(MouseEvent me) {
   int tab = topLevelTabbedPane.getSelectedIndex();
   if (tab != -1) {
     Rectangle tabBounds = topLevelTabbedPane.getBoundsAt(tab);
     if (!tabBounds.contains(me.getX(), me.getY())) {
       return;
     }
     if (me.getClickCount() == 1) {
       mySingleClick(tab);
     } else if (me.getClickCount() >= 2) {
       myDoubleClick(tab);
     }
   }
 }