How to convert JOptionPane String Input into an Int? [duplicate]

Try this:

    JOptionPane pane // your control
    int result = Integer.parseInt(pane.getInputValue().toString());
    System.out.println("result = " + result);

Leave a Comment