修改成这样String result= (String)javax.swing.JOptionPane.showInputDialog(null,"请输入一个整数","输入对话框",JOptionPane.PLAIN_MESSAGE,null,null,null);