You're right about the for loops, if you want to get input via keystrokes then the keystroke listener is the way to go.
And when a key is pressed, all
you should do is to change the state of the game. That often involves updating the GUI and it often involves changing internal variables of the game which keep track of things.
So changing the GUI would include the things you're doing right now using System.out (which can't be seen in normal Swing applications). And the internal variables are things like "game" and "p1played". (Although for me, I don't understand why "game" keeps track of a lot of things relevant to the game but it doesn't keep track of whether Player 1 has played.)
Anyway, yeah, you're on the right track. But normally you'd write some methods to do things, rather than having the long messy list of if-statements. For example: in several places you need to know whether there are two players. So perhaps the "game" object could tell you that via a "boolean hasTwoPlayers()" method. And then you've got duplicated code like "game.getPlayer(x).getPlayerKeys().contains(answer)" which could also be encapsulated in a "game" method like "boolean game.isCorrectAnswer(x, answer)". Basically the "game" object should be responsible for doing a lot of the things which you are doing in the code you posted there.