🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.swing
1 messages
1 total messages Started by Magnus Fri, 06 May 2005 16:29
Using MaskFormatter - flexible field length?
#423
Author: Magnus
Date: Fri, 06 May 2005 16:29
23 lines
1902 bytes
Hi,

I read "Using MaskFormatter" @ 
http://java.sun.com/docs/books/tutorial/uiswing/components/formattedtextfield.html

I like that the cursor is kept within "valid lengths" so that users 
can't put in Aaaaaaaaaaaaaaaaaaaaaaaaaa in a VARCHAR(10) field.
I know this can be validated afterwards though.

I have 2 questions:

1) I have a ZipCode field but sometimes Zip can be 9 long so I put my 
mask to "#########". Now 9 digits must be filled in. How can this be 
made so 0 to 9 digits is acceptable?

2) For a string field, mask "****" the TextField is padded with right 
spaces (" "). Upon clicking in a field like that the cursor is not in 
the end of the words written (if shorter than length) but rather in 
"open" space. Can this behavior be changed (i.e. no padding)?

Should I use another method for "cursor limiting".

Any and all help is appreciated.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads