Ok I'm just looking for a cleaner way to achieve my goal here, if there is one and if this is not much of a satisfactory method. The goal is to accept an integer from a user using JOptionPane.showInputDialog.
A brief example of what I'm currently doing
do
{
check = true;
try
{
num = Integer.parseInt(JOptionPane.showInputDialog("How many items do you need to list?"));
}
catch(NumberFormatException nfe)
{
nfe.printStackTrace();
check = false;
}
}while(!check);
Just curious for better methods, faster, cleaner etc. Thanks in advance