I created a program that has a for, this generates different values, what I need is to print the values in a JTextArea
as 8 values are generated. I've done the following:
int tp=2;
int pop[][] = new int[tp][8];
Random ran = new Random();
for(int i=0; i<tp; i++){
String texto="";
for(int j=0; j<8; j++){
int valor = ran.nextInt(2);
pop[i][j] = valor;
texto += valor+", ";
}
txtArea.setText(txtArea.getText()+"\n"+"Valor: "+texto);
}
Theoretically, you should set the value to JTextArea
, but this does not happen.
I do not know how to solve this problem.