// r: voidfunc(col, row) static JTable onTableCellLeftClick(final JTable table, final VF2 r) { swing { table.addMouseListener(new MouseAdapter { public void mouseClicked(MouseEvent evt) { if (evt.getButton() == 1 && evt.getClickCount() == 1) { int row = table.rowAtPoint(evt.getPoint()); int col = table.columnAtPoint(evt.getPoint()); table.setRowSelectionInterval(row, row); callF(r, col, row); } } }); } ret table; }