Can't detect double-click mouse events in Mustang

Discussion in 'Java' started by Wes Harrison, Jun 29, 2006.

  1. Wes Harrison

    Wes Harrison Guest

    The following relates to Mustang b89 on Windows Server 2003. It may well
    relate to earlier Java versions as well but I haven't tested it.

    I think my understanding of mouse clicked events is wrong because I don't
    get the behaviour I expect. When I implement the following code:

    table.getTableHeader().addMouseListener(new MouseAdapter()
    {
    public void mouseClicked(MouseEvent event)
    {
    System.out.println("Mouse event, clickCount = " +
    event.getClickCount());
    }
    }

    I get the following output for every double-click:

    Mouse event, clickCount = 1
    Mouse event, clickCount = 2

    Shouldn't it be just one event with a clickCount of 2? How can I tell the
    difference between the first event and a normal single-click?

    Thanks,

    Wes
     
    Wes Harrison, Jun 29, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Davisro
    Replies:
    2
    Views:
    1,316
    Jim Corey
    Apr 23, 2004
  2. Sydex
    Replies:
    12
    Views:
    6,506
    Victor Bazarov
    Feb 17, 2005
  3. =?Utf-8?B?am9qb2Jhcg==?=
    Replies:
    1
    Views:
    4,090
    wwwtar
    Oct 2, 2006
  4. Replies:
    1
    Views:
    106
    Richard Cornford
    Jul 7, 2006
  5. Daniish
    Replies:
    2
    Views:
    245
    Thomas 'PointedEars' Lahn
    Jun 13, 2008
Loading...

Share This Page