So I’m trying to make the game go to fully undecorated mode when user maximizes using the window maximize button.
so, I dispose(), setUndecorated(), setFullscreenWindow(frame)
and addListeners again. This worked for the MouseListener, but for some reason the KeyListener
doesn’t come back… Any clues?
you may not have the focus, maybe…
Yep focus is the key… very touchy on what order to do things. Thanks for the succinct advice DzzT.
It just makes a noob confused when one listener works nicely but another is somewhere else…
panel.addListeners();
popFrame.add(panel);
panel.requestFocusInWindow();
was trying to add focus too early. Interestingly, this works when going to fullscreen but returning does not… sigh
Another day goes by trying to figure this out…
Ah yes, finally got the combo - bloody oath that took a while again.
panel.setFocusable(true);
panel.validate();
panel.requestFocusInWindow();