View Single Post
  #1 (permalink)  
Old 05-14-2007, 04:43 PM
Nick15 Nick15 is offline
Member
 
Join Date: May 2007
Posts: 39
Nick15 is on a distinguished road
Jpassword problem
I'm using JPassword and KeyReleased event, when a key is pressed as "ctrl" and in the event I ask with getPassword for the first digit of the password, ctrl does not generate a character, it generates an exception java.lang. ArrayIndexOutOfBoundsException.

I tried with the following instruction to avoid the exception and worked out, but in the temp var (that is char type) didn't save anything
Code:
try { temp=Password.getPassword()[n]; } catch (ArrayIndexOutOfBoundsException e){}
How can I avoid the exception ?
what do I save in temp when I press ctrl ó Alt??
How can I ask if temp var is null?

Thanks you

Last edited by Nick15 : 06-01-2007 at 01:37 AM.
Reply With Quote
Sponsored Links