i add several swing component in fullscreen mode
it works nicely when i put non-container swing component
like JButton, JTextfield, JSlider…
but when i put container like JPanel, all keyboard input doesn’t work when i click some component in that container…
i can’t move the character or quit (by pressing ESC)
the problem is the main frame (JFrame) is lost the focus, and the container got the focus
if i request the focus back to main frame, it works again
mainFrame.requestFocus();
so can the mainFrame still have the focus when the container got the focus too?
or what method should i use, so when i click the mainFrame it will gain the focus again?
i addKeyListener and addMouseListener to the mainFrame (JFrame)
i try to add the listener to its contentPane but it getting worse, not working at all. >:(