Image

Imageirishmc wrote in Imagejava_dev

a quick gui-related question: I have a swing application that implements KeyListener looking for key events which in turn open up other windows. The problem is once these windows open and then close, my main jframe no longer has focus, and therefore the key listener doesn't get key events. I've been kludging it by calling parentFrame.requestFocus() once I get a window closing event for every possible window that could be opened, but I'm looking for a more elegant way to get focus back to my main frame. Does anyone have any suggestions?