borrar linea txt en un jtable
Publicado por Jorge (2 intervenciones) el 20/04/2016 00:57:07
Lo que tengo que hacer es borrar una fila txt que esta en un jtable y mi problema es que con este codigo me sale diciendo eerror y no entiendo porque
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
int dialogButton = JOptionPane.showConfirmDialog(null,
"Esta seguro que dese borrar?", "Warning",
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE);
if (dialogButton == JOptionPane.YES_OPTION) {
int Fila = jtUsuarios.getSelectedRow();
String Linea = (String) jtUsuarios.getValueAt(Fila, 0);
File Archivo = new File("Usuarios/" +Linea);
if(Archivo.delete()){
System.out.println("Se borro satisfactoriamente");
jtUsuarios.remove(Fila);
Modelo.BorrarDeLista(Fila);
IniciarlizarTabla();
}
}else{System.out.println("Error");
}
Valora esta pregunta


0