Hmm… maybe this will help then, but it alot of code 
public class GUI extends JFrame implements ZompocalypseGUI{
private GamePanel gamePanel;
private boolean running;
private int fps;
private int windowWidth;
private int windowHeight;
private Insets insets;
private Game game;
private String gameMode;
private KeyController keyController;
private MouseController mouseController;
private JButton singlePlayerBtn;
private JFrame titleMenu;
private int windowLocationX;
private int windowLocationY;
public GUI(int windowWidth, int windowHeight, int fps, Game game) {
this.gameMode = "waiting";
this.running = true;
this.fps = fps;
this.windowWidth = windowWidth;
this.windowHeight = windowHeight;
this.game = game;
this.keyController = new KeyController();
this.addKeyListener(keyController);
this.mouseController = new MouseController();
this.addMouseListener(mouseController);
Toolkit toolkit = Toolkit.getDefaultToolkit();
Dimension screenSize = toolkit.getScreenSize();
this.windowLocationX = (int) screenSize.getWidth();
this.windowLocationY = (int) screenSize.getHeight();
this.setTitle("Zompocalypse");
this.setSize(this.windowWidth, this.windowHeight);
this.setResizable(false);
this.setLocation((windowLocationX - windowWidth) / 2,( windowLocationY - windowHeight) / 2);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setVisible(true);
this.setIgnoreRepaint(true);
this.insets = this.getInsets();
setSize(insets.left + this.windowWidth + insets.right, insets.top + this.windowHeight + insets.bottom);
this.gamePanel = new GamePanel(windowWidth, windowHeight, this.game);
this.add(this.gamePanel);
openTitleMenu();
}
private void openTitleMenu() {
this.titleMenu = new JFrame("Zompocalypse - StartMenu!");
titleMenu.setSize(300, 400);
titleMenu.setResizable(false);
titleMenu.setLocation((windowLocationX - 300) / 2, (windowLocationY - 400) / 2);
titleMenu.setDefaultCloseOperation(EXIT_ON_CLOSE);
titleMenu.setLayout(null);
this.singlePlayerBtn = new JButton("SinglePlayer");
singlePlayerBtn.setSize(250, 30);
singlePlayerBtn.setLocation(25, 25);
singlePlayerBtn.addActionListener(this);
titleMenu.add(singlePlayerBtn);
titleMenu.setVisible(true);
}
@Override
public void run() {
while (running) {
long time = System.currentTimeMillis();
update();
render();
draw();
time = (1000 / fps) - (System.currentTimeMillis() - time);
if (time > 0) {
try {
Thread.sleep(time);
} catch (Exception e) {
System.out.println(e);
}
}
}
setVisible(false);
}
public void update(){
game.updatePlayer();
game.updateMobs();
}
public void render(){
gamePanel.render();
}
public void draw() {
gamePanel.draw();
}
public String getGameMode() {
return gameMode;
}
public void setGameMode(String gameMode){
this.gameMode = gameMode;
}
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(this.singlePlayerBtn)){
setGameMode("newGame");
this.titleMenu.setVisible(false);
}
}
private class MouseController implements MouseListener{
@Override
public void mouseClicked(MouseEvent e) {
Player player = game.getTileMap().getPlayer();
int xOffset = 19;
int yOffset = 12;
if(e.getButton() == MouseEvent.BUTTON3){
Point clickedPoint = e.getPoint();
int x = (int) (clickedPoint.getX() / 20) - xOffset;
int y = (int) (clickedPoint.getY() / 20) - yOffset;
Position targetPosition = new Position(x, y);
game.attack(player, targetPosition);
System.out.println("Attacking targetPosition: " + targetPosition.toString());
}
}
@Override
public void mouseEntered(MouseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent e) {
}
@Override
public void mouseReleased(MouseEvent arg0) {
// TODO Auto-generated method stub
}
}
private class KeyController implements KeyListener{
@Override
public void keyPressed(KeyEvent e) {
if(gameMode != "waiting"){
int key = e.getKeyCode();
Player player = game.getTileMap().getPlayer();
Position playerPosition = player.getPosition();
Position targetPosition;
int playerX = player.getPosition().getX();
int playerY = player.getPosition().getY();
Vector direction = player.getDirection();
if (key == KeyEvent.VK_A) {
targetPosition = new Position(playerX - 1, playerY);
game.setDirectionOnUnit(playerPosition, targetPosition);
game.moveUnitTo(playerPosition, new Position(playerX - 1, playerY));
}else if (key == KeyEvent.VK_D) {
targetPosition = new Position(playerX + 1, playerY);
game.setDirectionOnUnit(playerPosition, targetPosition);
game.moveUnitTo(playerPosition, new Position(playerX + 1, playerY));
}else if (key == KeyEvent.VK_W) {
targetPosition = new Position(playerX, playerY - 1);
game.setDirectionOnUnit(playerPosition, targetPosition);
game.moveUnitTo(playerPosition, new Position(playerX, playerY - 1));
}else if (key == KeyEvent.VK_S) {
targetPosition = new Position(playerX, playerY + 1);
game.setDirectionOnUnit(playerPosition, targetPosition);
game.moveUnitTo(playerPosition, new Position(playerX, playerY + 1));
}else if (key == KeyEvent.VK_E) {
// Action on item
Item i = game.getTileMap().getItemAt(playerPosition);
if (i != null) {
game.action(i);
}
// Action on building
Building b = game.getTileMap().getBuildingAt(playerPosition);
if (b != null) {
game.action(b);
}
}else if (key == KeyEvent.VK_R) {
// Action on Zombie
Position zombiePosition = new Position(playerX + direction.getX(),
playerY + direction.getY());
Zombie z = (Zombie) game.getTileMap().getUnitAt(zombiePosition);
if (z != null) {
if (game.isUnitWithinAttackRange(player, z)) {
System.out.println("Attacking: " + z.toString());
game.attack(player, z);
}
}
}else if(key == KeyEvent.VK_I){
System.out.println(player.getInventory().toString());
}
}
}
@Override
public void keyReleased(KeyEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void keyTyped(KeyEvent e) {
}
}
}