可以根据在mouseClicked中判断MouseEvent得clickCount来判断是不是双击

解决方案 »

  1.   

    继承实现MouseAdapter(根据你的程序改的。)private class ColorAction implements MouseAdapter
       {  
          public ColorAction(Color c)
          {  
             backgroundColor = c;
          }      public void mouseClicked(MouseEvent e){
             if(e.getClickCount()==2){
               setBackground(backgroundColor);
               repaint();
             }
          }      private Color backgroundColor;
       }
      

  2.   

    用e.getClickCount(),还可以通过e.getButtom()方法判断是左击还是右击