I have a problem. I want to show an array in a JOptionPane, I do it like that.
String[] continentes = { "ANorte", "ASur", "Africa", "Europa", "Asia", "Oceania" };
JOptionPane.showMessageDialog(null, Arrays.toString(continentes));
So, I show the array by the JOptionPane, but the problem is when I want to enter one of those values, or another, I'll take care of making an exception.
To collect a piece of information from a JOptionPane, I usually do this:
String aux= JOptionPane.showInputDialog("Introduce algo");
And now, aux, it has a string with what you have entered, but if I put:
String aux = JOptionPane.showMessageDialog(null, Arrays.toString(continentes));
I get this error,
Type mismatch: can not convert from void to String []
and I do not know how to solve it. I want a square to appear to enter a name and be able to pick it up.
I thank everyone, it will surely be a very simple mistake, but I have not found anything.