Why don't you creat your own
Document perhaps a class that extends
PlainDocument then all you would have to do is override the
insertString method and check the length of the
String that is trying to be inserted. If its length is greater than 1 then don't do anything. If it has length then it means that the user most likely has typed it in so just call the
insertString method of the super class with the String.
To create the textfield all you have to do is when you construct the textfield use the constructor with the document.
I think this is probably easier then listening for key events.
Hope this helps.