0 Replies Latest reply: May 3, 2007 1:02 PM by 807596 RSS

    Problem in mouseClicked(MouseEvent e) on clicking JComboBox

    807596
      I am adding this MouseListener to my JComboBox and when I click onto that JComboBox, mouseClicked(MouseEvent e) is not fired. Instead, it is calling mouseEntered() and mouseExited(). Basically, I need to execute a sql query on click on the JComboBox. Can anyone help me to resolve this issue..

      Code for the listener....

      class MyMouseListener implements MouseListener {

      public void mouseClicked(MouseEvent e) {
      System.out.println("MouseClicked");

      int b=e.getModifiers();
      System.out.println(b & InputEvent.BUTTON1_MASK);
      System.out.println(b & InputEvent.BUTTON2_MASK);
      System.out.println((b & InputEvent.BUTTON3_MASK)+"\n");

      }
      public void mouseEntered(MouseEvent e) {
      System.out.println("mouseEntered");
      int b=e.getModifiers();
      System.out.println(b & InputEvent.BUTTON1_MASK);
      System.out.println(b & InputEvent.BUTTON2_MASK);
      System.out.println((b & InputEvent.BUTTON3_MASK)+"\n");

      }
      public void mouseExited(MouseEvent e) {
      System.out.println("mouseExited");

      }
      public void mousePressed(MouseEvent e) {
      System.out.println("mousePressed");
      }
      public void mouseReleased(MouseEvent e) {
      System.out.println("mouseReleased");
      }

      }