KeyListener - JTextField

I have a jtextfield. When a certain length of characters are entered into the field I want to use them in a function and clear the field. When I do this, my following function works but the character from the key pressed is set as the textfield text AFTER I clear it so the field is no longer clear. How can I fix this problem?

Thanks

[347 byte] By [KyleHaddena] at [2007-11-26 12:57:33]
# 1
Were you going to post some code?
hunter9000a at 2007-7-7 16:54:05 > top of Java-index,Java Essentials,Java Programming...