Mi objeto "pacman" no se mueve... no entra a la clase de adaptadora ( que es la de KeyListener)
Código:
No entra dentro del keyPressed.... public class Tablero extends JPanel implements ActionListener { Pacman pacman; Timer timer; public Tablero() { addKeyListener( new Tadaptadora()); setFocusable(true); pacman=new Pacman(); setBackground(Color.black); timer=new Timer(30,this); timer.start(); } public void paint (Graphics g) { super.paint(g); Graphics2D g2d=(Graphics2D) g; g2d.drawImage(pacman.getImage(),pacman.getX(),pacman.getY(),this); } public void actionPerformed (ActionEvent e) { pacman.movePacMan(); repaint(); } private class Tadaptadora extends KeyAdapter { public void keyReleased (KeyEvent e) { pacman.keyReleased(e); } public void keyPressed (KeyEvent e) { System.out.println("Presionó Espacio!"); pacman.keyPressed(e); } } }