I would like to know how I have to do to gather in a single JOptionPane all the values that I enter by keyboard and not one by one. I am starting to use the windows of the JOptionPane and I have not finished clarifying at all. Thanks!
import javax.swing.JOptionPane; public class NumeroTeclado {
public static void main(String[] args) {
int [] dato = new int [10];
int num = 1;
for(int i = 0; i<dato.length; i++) {
dato[i] = Integer.parseInt( JOptionPane.showInputDialog("Introduzca el valor " +num));
num++;
}
num = 1;
for(int i = 0; i<dato.length; i++) {
JOptionPane.showMessageDialog(null, "El valor de la posición " + num + " es: " + dato[i]);
num++;
}
}
}