Can't detect double-click mouse events in Mustang

W

Wes Harrison

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top