guarda questo esempio, preso da una classe che ho realizzato qualche giorno fa:
codice:
jTable1.addMouseListener(new MouseListener(){
public void mouseClicked(MouseEvent arg0) {
doubleClickCatcher++;
int row=jTable1.getSelectedRow();
// INTERCETTO IL DOPPIO-CLICK
if(doubleClickCatcher%2==0){
try {
Desktop desktop = null;
if (Desktop.isDesktopSupported()) {
desktop = Desktop.getDesktop();
}
// filePaths E' UN ARRAY LIST DI FILENAME
desktop.open(new File(filePaths.get(row).getNomeFile()));
} catch (IOException ioe) {
ioe.printStackTrace();
}
catch (IllegalArgumentException n){
return;
}
} // fine if()