public void setKeyListener(Component component) {
		component.addKeyListener(new KeyListener() {
			
			@Override
			public void keyTyped(KeyEvent e) {
			}
			
			@Override
			public void keyReleased(KeyEvent e) {
			}
			
			@Override
			public void keyPressed(KeyEvent e) {
				if(isGameOver()) {
					int result = JOptionPane.showConfirmDialog(frame, "No more movement can be made.\nPlease try another time!", "Game Over", JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE);

					if(result == JOptionPane.OK_OPTION) {
						initCells();
						startGame();
						return;
					}
				}
				switch (e.getKeyCode()) {
				case 37:
					moveLeft();
					break;
				case 38:
					moveUp();
					break;
				case 39:
					moveRight();
					break;
				case 40:
					moveDown();
					break;
				default:
					break;
				}
			}
		});
	}