Hello,
While building an application i found myself needed to make a doubleclick event.
This is working however, not 100%.
this is becouse the defoult doubleclick action (editing the table) isn't set off.
i looked over the internet but found nothing that helped
yes i even tried:
import javax.swing.table.DefaultTableModel;
class MyTableModel extends DefaultTableModel {
// Insert the instantiator methods I use here
public boolean isCellEditable(int row, int column) {
return false; // Super returns true.
}
}
but it doesn't work.
any and all help would be appriciated.
thanx in advance,
reefclaw
p.s. for those that are interested in my doubleclick function:
TA_Results.addMouseListener(new MouseAdapter()
{
public void mouseClicked(MouseEvent e)
{
// if (e.getClickCount() == 2)
// {
if(clickedCount == 0)
{
Date now = new Date();
startTijd = now.getTime();
}
if(clickedCount == 1)
{
Date now = new Date();
eindTijd = now.getTime();
}
clickedCount ++;
if(clickedCount == 2 )
{
clickedCount = 0;
if(startTijd - eindTijd < 250)
{
JTable target = (JTable) e.getSource();
int row = target.getSelectedRow();
int column = target.getSelectedColumn();
bekijken();
}
}
}
//}
});