Input multiple numbers in JOptionPane
I have an assignment to create a java program in which the user will enter 12 random numbers using JOptionPane and store them in an array then output the highest and lowest numbers. I tried to use for loop for the JOptionPane but it results only in multiple dialog boxes and only one number can be input in each of them. I'm new to java, and I'm still confused about using JOptionPane. Can you please help me with how can I make it to one dialog box only for all those 12 numbers? This is my code. int num[] = new int[12], x; int highest = num[0], lowest = num [0]; for(x=0; x < num.length; x++) { num[x] = Integer.parseInt(JOptionPane.showInputDialog("Enter 12 random numbers:")); } for(x=0; x < num.length; x++) { if(highest < num[x]) { highest = num[x]; } else if (lowest > num[x]) { lowest = num[x]; } }