-
17 Jul 2008 9:42 AM #1
How i make a mask for a TextField
How i make a mask for a TextField
like a JformattedTextField. Example phone : (##)####-####
ty for all
-
18 Jul 2008 8:00 AM #2
I second this. Anyone knows how to do masking?
-
18 Jul 2008 1:21 PM #3
I need this too and I'm working on releaseing a UX that will have this feature... simple to the Swing widget of the same name... hopefully in the next day or two
-
20 Jul 2008 6:17 PM #4
-
21 Jul 2008 12:09 PM #5
-
22 Jul 2008 3:46 AM #6
Not sure if this is what everyone wanted - turned out to be really simple.
You would use it like...Code:public class FormattedNumberField extends NumberField { @Override protected void onBlur(ComponentEvent be) { super.onBlur(be); setRawValue(getFormat().format(getValue().doubleValue())); } }
Code:FormattedNumberField annualsalary = new FormattedNumberField(); annualsalary.setFieldLabel("Annual Salary"); annualsalary.setFormat(NumberFormat.getCurrencyFormat()); panel.add(annualsalary);
-
23 Jul 2008 2:50 AM #7
Cheers. Did it the same way.

But I was also actually thinking of something which limits the input and skips fixed characters of the format. E.g. a format like "(XXX)-XXXX XXXX" where the cursor automatically skips chars like ()- and jumps to the next available input position. Nothing really important, would be just a nice UI gimmick though.
Thomas


Reply With Quote