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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jpanel + keylistener

Status
Not open for further replies.

freggy

Programmer
Nov 7, 2001
4
BE
is there someone who can tell me how to use keylisteners in java without using textfields or textarea's? i have a jpanel with mouselisteners. if a key is pressed e.g. shift, another block of code needs to be execute then without pressing the key.

thanks
frederic
 
you can add a key listener to anything you've attached the mouselistener to. As far as I am aware, as long as the component with the listener has foucs when the event is triggered, it should be caught.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top