Just started learning java and I'm trying to make a calculator with JPanes in the easiest way possible. I can manage to get it to do simple concatenation, but I can't get it to add the entered numbers together. Any help is appreciated.
import javax.swing.*;
public class fiveInputs{
public static void main (String [] args) {
java.lang.String num = "";
java.lang.String num2 = "";
java.lang.String num3 = "";
java.lang.String num4 = "";
java.lang.String num5 = "";
num = JOptionPane.showInputDialog("First number: ");
num2 = JOptionPane.showInputDialog("Second number: ");
num3 = JOptionPane.showInputDialog("Third number: ");
num4 = JOptionPane.showInputDialog("Fourth number: ");
num5 = JOptionPane.showInputDialog("Fifth number: ");
java.lang.String sum = "";
if (sum.equals(""));
JOptionPane.showInputDialog (num - num2 - num3 - num4 - num5);
System.out.println(sum);
}
}