I am writing a program that needs to accept input from a bar code scanner, which is really not the issue since most scanners are just a keyboard, but because I can't trust the users to input non-falsified information I need certain text boxes to accept input from the scanner and the scanner only. how do I determine from what device text input is coming from?
If the operating system makes them look exactly like the keyboard, you don't have any hope of figuring out what hardware your keyboard inputs are coming from. (Or at least not much hope... scanning a barcode might send keystrokes faster than a human can, and you might be able to discern that with a KeyListener or something.) But I'd say your best approach would be, since it's an operating-system or hardware issue, to solve the problem at the operating-system or the hardware level.