Keyboard input isn't working

I have a very simple game which consists of nothing but a blue rectangle (the paddle) against a red background. The program is made up of three classes: Game, Paddle, and Input. The input allows for both mouse and keyboard functionality, but for some reason only the mouse input is working, not the keyboard. I’ve reviewed the code several times and can’t figure out what is causing the problem. Can anyone check my code and tell me what I’m doing wrong?


import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class Game extends JPanel implements Runnable {
	
	private static final long serialVersionUID = 1L;
	
	private Image dbImage;
	private Graphics dbG;
	
	static Thread thread;
	
	public static final int APPLICATION_WIDTH = 400;
	public static final int APPLICATION_HEIGHT = 300;
	
	private Input input;
	private Paddle player;
	
	public Game() {
		Dimension size = new Dimension(APPLICATION_WIDTH, APPLICATION_HEIGHT);
		setSize(size);
		setPreferredSize(size);
		setFocusable(true);
		
		input = new Input();
		addKeyListener(input);
		addMouseMotionListener(input);
		
		thread = new Thread(this);
		
		player = new Paddle(50, 250);
	}

	@Override
	public void run() {
		while(true) {
			player.update();
			repaint();
			try {
				Thread.sleep(17);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}	
	}
	
	public void update (Graphics g) {
		dbImage = createImage(APPLICATION_WIDTH, APPLICATION_HEIGHT);
		dbG = dbImage.getGraphics();
		paint(dbG);
		dbG.drawImage(dbImage, 0, 0, this);
		
	}

	public void paintComponent (Graphics g) {
		super.paintComponent(g);	
		g.setColor(Color.red);
		g.fillRect(0, 0, APPLICATION_WIDTH, APPLICATION_HEIGHT);
		player.paintComponent(g);	
	}
	
	public static void main(String args[]) {
		Game g = new Game();
		thread.start();
		JFrame frame = new JFrame();
		frame.setResizable(false);
		frame.add(g);
		frame.pack();
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setLocationRelativeTo(null);
		frame.setVisible(true);
	}
}


import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;

public class Input extends KeyAdapter implements MouseMotionListener {
	
	private static boolean[] keys = new boolean[2 << 16];
	private static int mx;

	public void keyPressed(KeyEvent e) {
		keys[e.getKeyCode()] = true;
	}

	public void keyReleased(KeyEvent e) {
		keys[e.getKeyCode()] = false;
	}
	
	public void mouseDragged(MouseEvent e) {
		
	}

	public void mouseMoved(MouseEvent e) {
		mx = e.getX();
	}
	
	public static boolean isKeyPressed(int keycode) {
		return keys[keycode];
	}
	
	public static int getMX() {
		return mx;
	}
}


import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.KeyEvent;

public class Paddle {
	
	private int x, y;
	private final int WIDTH = 100;
	private final int HEIGHT = 10;
	
	public Paddle(int x, int y) {
		this.x = x;
		this.y = y;
	}

	public void update() {
		x = Input.getMX();
		
		if (Input.isKeyPressed(KeyEvent.VK_LEFT))
			x -= 10;        
		if (Input.isKeyPressed(KeyEvent.VK_RIGHT))
			x += 10; 	
		
	}
	
	public void paintComponent(Graphics g) {
		g.setColor(Color.blue);
		g.fillRect(x, y, WIDTH, HEIGHT);
	}
}