How do you use an integer type with JOptionPane.showInputDialog


2003-12-20 05:02:06 PM
jbuilder23
Im a beginner here :) Im trying to have the user input an
integer...how do you do this? It seems whatever is inputted into the
InputDialog box is a string...is there a way to change the data type
for this command? This is my piece of code:
...
int invQty;
invQty = JOptionPane.showInputDialog (null, "What is the quantity of
\"" + invName + "\"?","Enter Quantity", JOptionPane.QUESTION_MESSAGE);
...
Thanks