This is what I changed. it compiles, but I am still not able to start a new line after 40 numbers show.
public class MyAction implements ActionListener{
public void actionPerformed(ActionEvent e){
String input = JOptionPane.showInputDialog(null,
"Enter the size of the array: ");
int arraySize = //console.nextInt();
Integer.parseInt(input.trim());
int[] list = new int[arraySize];
for (int arrayIndex = 0; arrayIndex < list.length; arrayIndex++){
list[arrayIndex] = arraySize - arrayIndex;}
values = Arrays.toString(list);
if ((arraySize - 0 + 1) % 40 != 0)
JOptionPane.showMessageDialog(frame, values + " " +
"are your numbers", "Your Silly Numbers",
JOptionPane.INFORMATION_MESSAGE);
}
}