Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_java thread: the return value of showInputDialog?


Message #1 by Edward Konvalo <zhangsc@n...> on Tue, 09 Apr 2002 13:57:08 +0800
This is a multi-part message in MIME format.

--Boundary_(ID_Ycygflky4vjFYqxLEcIIng)
Content-type: text/plain; charset=gb2312
Content-transfer-encoding: 7BIT

I want to get a number until a number is input,it likes:
   String number=null;
   while(number==null)
      number=JOptionPane.showInputDialog("Input number");
   ...
   int i=Integer.parseInt(number);
   ...
 In sometimes,user will may click Ok button with forgetting
 input number.In this case,I think number value is not 'null'
 because Java will out of while statement and execute follow
 statement.But I don't what the value of the  number,number="\r\n"???

Any idea will be appreciated!
Regards,
Edward




  Return to Index