Pessoal, tenho seguinte código:
import javax.swing.JOptionPane;
import java.util.Random;
public class Exercicio0904 {
public static void main (String [ ] args) {
String str = "";
int nr_pessoas = 0;
String nome = "";
int senha = 0;
int numero = 0;
char [ ] codigo = new char [ ] {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'};
Random rdm = new Random ( );
for (int j = 1; j <= 8; j++)
senha += codigo [ rdm.nextInt (10) ];
str = "Quantos candidatos?";
String num = JOptionPane.showInputDialog (null, str);
nr_pessoas = Integer.parseInt (num);
String [ ] [ ] lista = new String [nr_pessoas] [senha];
for (int i = 1; i <= nr_pessoas; i ++) {
str = "Nome " + i;
nome = JOptionPane.showInputDialog (null, str);
lista [i - 1] [0] = nome;
}
System.exit (0);
}
}
Eu quero que cada pessoa receba uma senha, como monto isso e exibo no JOptionPane?
Quem puder ajudar, obrigado!