public static void main(String[] args) {
int num = 0;
int result = 0;
do{
input_num = JOptionPane.showInputDialog(null, "Input a number for calculation", "The calculation for the sum of some number",
JOptionPane.QUESTION_MESSAGE);
num = Integer.parseInt(input_num);
result += num;
} while (num != 0);
System.out.println("The sum of those number is " + result);
}
}