its a basic calculator that sums number and i want to make a GUI for it but i dont know where i messed up please help

import java.util.Scanner;
import javax.swing.*;
public class Sum {
	public static void main (String args []){
		Scanner result = new Scanner(System.in);
		
		int num1;
		int num2;
		int sum;
		
		System.out.println("Write the first number");
		num1 = result.nextInt();
		
		System.out.println("Write the second number");
		num2=result.nextInt();
		
		sum=num1+num2;
		System.out.print("the result:" + sum);
		
		String ask1 = JOptionPane.showInputDialog(sum);
		Integer.parseInt(ask1);
		
		String message = String.format("the result is:", sum);
	
	} }

Edit: Nevermind that.

You use the JOptionPane for each of the numbers, not the sum.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.