Barcode reader input and JTextField

Hi Everybody,

here is my problem: I have to read the input from a Barcode reader into a JTextField;

I have a Listener attached to the JTextField Document which works fine. The problem is that the listener is invoked as many time as the characters input (e.g 12 times, if the scanned barcode has 12 digits)

How do I know the input is complete if I don't know the length of the expected input?

Thanks in advance fon any help or ideas

[463 byte] By [S.O.S.a] at [2007-11-27 10:22:44]
# 1

What kind of Listener have you attached to the TextField?

Most bar code readers can be configured to finish the scan with a carriage return in which case if you use an ActionListener then it would solve your problem

c0demonk3ya at 2007-7-28 17:17:48 > top of Java-index,Desktop,Core GUI APIs...
# 2

That was the solution, thanks a lot!!

S.O.S.a at 2007-7-28 17:17:48 > top of Java-index,Desktop,Core GUI APIs...