I won't go through the code you have here exactly, rather just go over the JOptionPane.
The method you want for input is JOptionPane.showInputDialog. This is always a string, so in order to capture it as valid data:
PHP Code:
int starting = -1;
boolean bValid = false;
do
{
try
{
Integer input = Integer.parseInt(JOptionPane.showInputDialog("Enter starting population of organisms: "));
starting = input.intValue();
bValid = true;
// whatever other validation you need here, can throw an exception (change exception below if you do).
}
catch (NumberFormatException ex)
{
JOptionPane.showMessageDialog(null, "Invalid input!", "Error", JOptionPane.ERROR_MESSAGE);
}
}
while (!bValid);
And so forth.
BTW, you can easily combine the swing and the system.out. That's not an issue, but it does mean if you want to see it you have to launch it from the command line as you won't see the messages unless you redirect them elsewhere.