I am trying to import a list from a txt file, but the reader skips the first line and also adds the last "null" line that the file writer adds.
I fixed the null part but I can't seem to be able to add the first line in the list.
BufferedReader bf = new BufferedReader( new FileReader(importpath+"\\additional_info\\"+name+".txt"));
//System.out.println(importpath+"\\"+name+".txt");
String line = bf.readLine();
listModel.removeAllElements();
while (line != null) {
line = bf.readLine();
if(line == null){
}else{
listModel.addElement(line);
}
}
bf.close();
System.out.println(listModel);
clipsLineList.setModel(listModel);