ActionListener conflicting Keylistener
Hello. I am creating a pong app. the game itself works great, so I decided to introduce a title page into the application. to create this title page, I created an if statement in the paint() method to only paint the title screen when an integer called lvl was equal to 0. The main class has a key listener while the JPanel has an actionlistener. when the title page is drawn, it has a button called start, which increases the lvl integer to 1, where the game will start. If I press this button, the scene will change, but the keystrokes will not respond. If I start the game on lvl 1 instead of the title page, the keystrokes work. If I start the game on the title page, I can get response from the keys UNTIL I have pressed the button to increase the integer. Does anyone have any solutions for me? Any and all comments are greatly appreciated.