do {
number = (String)JOptionPane.showInputDialog(null,"Quantity : ","TRIAL",JOptionPane.QUESTION_MESSAGE);
if(number.matches("\\d+")) {
qty = Integer.parseInt(number);
}
// JOptionPane.showMessageDialog(null,"Invalid input !\n\nMin = 1\nMax = 100","TRIAL",JOptionPane.ERROR_MESSAGE);
} while(qty < 1 || qty > 100);
JOptionPane.showMessageDialog(null,number);
if I put the error message inside or outside if, the error message still appear if user key-in right data