I have a input dialog that gets the password. When i enter a value and
click OK it works fine. But when i click Cancel i get a Null Pointer
Exception. How to handle the Cancel button
Any help in this regard would be greatly apprecialted
thanks in advance
Bala
Andrew Thompson - 30 Sep 2004 15:22 GMT
> But when i click Cancel i get a Null Pointer
> Exception. How to handle the Cancel button..
Catch it.

Signature
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
Dirk Gerrit Oort - 30 Sep 2004 15:26 GMT
The api say:
Returns:
user's input, or null meaning the user canceled the input
so test before use on null

Signature
D.G. Oort
>I have a input dialog that gets the password. When i enter a value and
> click OK it works fine. But when i click Cancel i get a Null Pointer
[quoted text clipped - 4 lines]
> thanks in advance
> Bala
Paul Lutus - 30 Sep 2004 16:02 GMT
> I have a input dialog that gets the password. When i enter a value and
> click OK it works fine. But when i click Cancel i get a Null Pointer
> Exception. How to handle the Cancel button
Detect the null and deal with it. One way to deal with it is to assume it
meant the user pressed "Cancel".

Signature
Paul Lutus
http://www.arachnoid.com