Given the rules you have specified here, you can tokenize and cast the strings. Pulling from an array of String broken with a space is also sufficient.
This is almost entirely correct. The problem is you cannot pull from String[x] as String is a datatype, not a variable. You need to pull from values[x] instead.
Next to this, a try/catch should be used:
String values = data.split(" ");
num1a = values;
sign = values;
num2a = values;
num1 = Double.parseDouble(num1a);
num2 = Double.parseDouble(num2a);
double dResult = 0.0;
dResult = num1 + num2;
else if (sign.equals("-"))
dResult = num1 - num2;
else if (sign.equals("*"))
dResult = num1 * num2;
else if (sign.equals("/"))
dResult = num1 / num2;
JOptionPane.showMessageDialog(null, "The result is: " + dResult);
catch (NumberFormatException ex)
"There has been an error in input: " + ex.getMessage(),
catch (ArrayIndexOutOfBoundsException ex)
"There appears to be an error in input format (double op double expected)",
Switch can also be used on the sign, but only if it's cast to a char (Java does not allow switches on objects, and String is an object not a primitive).