As I said in another question answered I have a list that I use as a line counter and it works fine but now the problem is here when I open a file anybody tells me all the lines well but starting from 2 years ago I put them to write me too in the console and in the console write well from 1 but I do not understand why it does not do the same in the list. Part of my code here
String archivo=new String(rutas.getText()); //obtiene el texto de la ruta especificada
File archivos = new File(archivo);
editor.setText(null);
int lotos = texto;//obtiene las lineas del archivo anterior
int lineas = 0;//especifico las lineas desde 0
try {
BufferedReader leer = new BufferedReader(new FileReader(archivo));
String linea = leer.readLine();
while (linea != null) {
modelolista.remove(modelolista.size() -lotos);//resto las lineas del anterior archivo
editor.append(linea+"\n");
linea = leer.readLine();
lineas++;//incremento asta llegar a la ultima linea
modelolista.addElement(lineas);//añade las lineas incrementadas
System.out.println(lineas);//imprime en la consola las lineas
}
}
catch (Exception ex) {
Logger.getLogger(ed.class.getName()).log(Level.SEVERE, null, ex);
}
Thanks for the help