checking input

Hey,

I am making a program that scans barcodes.

I want to check if the scanned barcode is valid, so I let it put the scanned code into a textfield. But now I don't know what listener I have to add, so that when the barcode is completely filled in the processing can start. I have tried with a keylistener, but that doesn't work, because the code that has to be executed is done as soon as one char is filled in. What else can I do?

Frederik

[467 byte] By [FreVdha] at [2007-11-26 17:28:13]
# 1
Use a DocumentListener.
PhHeina at 2007-7-8 23:56:09 > top of Java-index,Desktop,Core GUI APIs...
# 2
i can't use that, because it can only be used when using jTextFields, but I can't use them on the scanner.
FreVdha at 2007-7-8 23:56:09 > top of Java-index,Desktop,Core GUI APIs...
# 3
Huh?! [quote]put the scanned code into a textfield. [/quote]
PhHeina at 2007-7-8 23:56:09 > top of Java-index,Desktop,Core GUI APIs...
# 4
wellexample:private java.awt.TextField txtGescandeBarcodetxtGescandeBarcode.addDocumentListener (doesn't exist).I can't use javax.swing.jTextField
FreVdha at 2007-7-8 23:56:09 > top of Java-index,Desktop,Core GUI APIs...
# 5
Ok, a http://java.sun.com/j2se/1.5.0/docs/api/java/awt/event/TextListener.htmlthen.
PhHeina at 2007-7-8 23:56:09 > top of Java-index,Desktop,Core GUI APIs...