Olá galera, estou com um pequeno problema na hora da impressao de um array, cujo pego os dados em um .txt. Segue o code:
private void imprimir()throws IOException{
ArrayList<Pessoa> array = new ArrayList<Pessoa>();
BufferedReader leitor = new BufferedReader(new FileReader("output.txt"));
String linha = null;
while((linha == leitor.readLine())){
Pessoa p = new Pessoa();
p.setNome(leitor.readLine());
p.setScore( leitor.readLine());
array.add(p);
}
Collections.sort(array);
String mostra="";
// carregando a string para imprimir
int v=0;
for(Pessoa i: array){
mostra = mostra + i.nome+" "+String.valueOf(i.score)+"\n";}
JOptionPane.showMessageDialog(null,"NOME SCORE\n"+mostra);
}
Agradeço a ajuda de todos.
