JOptionPane Input to int

前端 未结 5 1535
面向向阳花
面向向阳花 2021-01-02 14:31

I am trying to make a JOptionPane get an input and assign it to an int but I am getting some problems with the variable types.

I am trying something like this:

5条回答
  •  时光取名叫无心
    2021-01-02 15:12

    Please note that Integer.parseInt throws an NumberFormatException if the passed string doesn't contain a parsable string.

提交回复
热议问题