Problem

Capture mouse double-click on a table row


Solution

Usual desktop interfaces use "double-click" event to "open" an item. As an example imagine you have a table with row items each representing an ordered item and you want to open a form to interact with all the attributes/columns of the item.

In form designer select the table and the go to the Event tab, select the event "cellMouseClicked" and enter the name of your function which will handle the event.

The event "cellMouseClicked" will be called for single click and double one. The way to distinguish the two is something like this:

if (e.getClickCount() == 2) {

   // Your code here....

}

Published in Mon, 13 December 2010 12:03