I am making Tetris in Java. I have the Grid as its own class (extends JPanel) a menu bar (also extends JPanel) and a class for the main game window (extends JFrame). I created instances of the Grid and the menu bar inside the main game window class and added them to a wrapper JPanel. I put the keyListener (which calls methods from the instance of the Grid) in the main game window class, but it doesn't work. Where should I implement the keyListener if I want it to change things in the Grid?
Xeros606 0 Newbie Poster
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.