Reading from barcode scanner
Posted by Emilio Miguelanez Martin on Feb 06, 2008; 11:58pm
URL: http://imagej.273.s1.nabble.com/Reading-from-barcode-scanner-tp3697230.html
Hello,
I want to incorporate the reading of a barcode scanner into a plugin. The
barcode scanner is connected through a USB connection.
In a standalone program, I can acquire the reading by
public static void main(String[] args) throws Exception{
InputStream in = System.in;
int b;
while (true)
{
b = in.read();
if (b==-1) break;
// do something...
System.out.println((char)b);
}
}
But when I code it in imageJ plugin, it doesn't work. Basically, imageJ gets
completely stuck (Not responding).
Any ideas how to solve it?
Thanks in advance,
Emilio