Jay
Jay

Reputation: 143

How do I add a KeyListener to an entire project?

I am developing an app that requires multiple JFrames. The JFrame writes to a file, then is disposed. I want to have a KeyListener listen for the same key press, throughout the entire project without having to create the KeyListener in each class. Is there a way?

Upvotes: 0

Views: 473

Answers (1)

Green Day
Green Day

Reputation: 664

I agree that key bindings should be used, but since I can't delete my accepted answer I have to leave this here.

Upvotes: 3

Related Questions