How do I list an ArrayList inside a JLabel [duplicate]

0

I would like to know how to print an ArrayList inside a JLabel, I am using JOptionPane but it shows one element at a time I would like to display all elements in a single window. Here is the function code that does this, such as Can I redo it?

    public void pesquisar(int i){

    for(i=0 ; i < pessoas.size() ; i++){

        JOptionPane.showMessageDialog(null,Pessoa.toString());
      }



  }
    
asked by anonymous 21.05.2017 / 18:31

0 answers