Skip to main content

Problems entering a PIN#

1 reply [Last post]
tleylan
Offline
Joined: 2006-02-14
Points: 0

I'm trying to get a TextField to work a particular way. When entering a PIN# I want all the values associated with a key to equate to the numeric value so A, B, C and 2 is a 2, etc. I created a subclass of TextField overriding keyPressed and keyReleased manipulating the text with getText and setText. This works great but doesn't handle backspacing.

I modified the event to adjust the key code value and then call super.keyReleased but when it finds it's way to the TextArea class (through TextField.keyReleased) that code insists on drawing a textbox the maximum size of the screen and that isn't what I'm looking for.

Any suggestions for a simple edit control that can be used for entering a PIN# regardless of how the keyboard is set and without popping up additional components? Thanks.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tleylan
Offline
Joined: 2006-02-14
Points: 0

I thought I would add that I can clearly watch for a backspace key code -8 and I've added that so the immediate problem is gone. I'm still interested to hear opinions if there is a better (more standard) way to customize inputs or if I'm likely to encounter compatibility problems because I'm suppressing the pop-up editor style input?

Is each input field in a multiple input form typically supposed to pop-open? Thanks.