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.
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.