Maximum text length

I have this code:

JFormattedTextField jft=new JFormattedTextField(new MaskFormatter("###"));

I thought that this will allow text to be maximum length 3 but this code actually demands that length must be exactly 3 numbers.

How do I make that I can type maximum 3 numbers?

[386 byte] By [BobMila] at [2007-11-27 5:29:39]
# 1
did you tryformatter.setPlaceholderCharacter(' ');on your formatter to set the unused space to blank?
martin@worka at 2007-7-12 14:53:02 > top of Java-index,Java Essentials,Java Programming...
# 2
Yes I did, but still doesn't work.When I press enter if there is less then 3 numbers field gets blank.
BobMila at 2007-7-12 14:53:02 > top of Java-index,Java Essentials,Java Programming...