Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keylistener for jPanel

Status
Not open for further replies.

mes123

Programmer
Jul 29, 2005
62
0
0
GB
I have a jPanel (that contains amoungst other things a jScrollPane and JTable). I'm trying to get input from a barcode reader to display in the table.

Since this GUI will run on a touch screen I don't want to have to forch the use to set the focus on the table or any sort of textfield. I just want them to be able to scan an item with the barcode scanner and trap the data (the barcode scanner can be thought of as just a keyboard).

Is there a way of attaching a keyListener to the jPanel so that it can accept keyboad input? I can make the table and scrollpane non focusable then (I don;t really want the use being able to input directly in then anyhow)

Thanks in advance.

 
please do not post non-J2EE questions in this forum (your profile says you know where the Java forum is)

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
sorry sedj, I looked at both forums but couldn't decide which one this falls under. (I'll repost it in the correct place now).

What is the destinction between the two?
 
This forum is only meant to be for J2EE (Java 2 Enterprise Edition) - ie questions about J2EE related technologies - EJB, JMS, JTA etc.

The other forum269 is meant for standard J2SE (Standard Edition) questions - ie all the core APIs like Swing, IO, collections etc.

Cheers

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top