int num=Integer.parseInt(JOptionPane.showInputDialog(" Enter a NUMBER: "));
Printable View
int num=Integer.parseInt(JOptionPane.showInputDialog(" Enter a NUMBER: "));
See this post:
Java calculator
It basically is implementing the shunting-yard algorithm, but is slightly out of date. I think I have a newer version of that code somewhere on my computer, but it's currently not working because I was mucking about with some variable parameters stuff :P