Hi everyone,
I have a small problem which hopefully has a solution! I have a JTable which represents a bunch of objects, that when double clicked opens an editor which permits us to view the information related to the objects.
One of the JTable's columns has in each row, the subject/title of the object it represents.
I have a MouseAdapter on the table which currently successfully captures the double-click to open event. I'd like to add a second event, that permits the cell editor to fire, if the user single clicks the row when it was already selected.
Problem:
else if( e.getClickCount() == 1 && table.isRowSelected( row ) ){
System.out.println( e.getClickCount() );
int column = table.columnAtPoint( e.getPoint() );
table.editCellAt( row, column );
table.setEditingRow( row );
table.setEditingColumn( column );
table.repaint();
}
This code seems to intercept the doubleclick event! It would appear that the doubleclick selects the row after the first click, and not after the second.
How then can I achieve the functionality desired?
Regards.
Alex