@Override
	public void run() {

    	init();
        
        setIconImage(config.getJetrisIcon());
        
        keyHandler = new KeyAdapter(){

            @Override
            public void keyPressed(KeyEvent e) {
                int code = e.getKeyCode();
                Move move = Move.DOWN;
                if(code == KeyEvent.VK_A || code == KeyEvent.VK_LEFT) {
                    move = Move.LEFT;
                } else if(code == KeyEvent.VK_D || code == KeyEvent.VK_RIGHT) {
                    move = Move.RIGHT;
                } else if(code == KeyEvent.VK_S || code == KeyEvent.VK_DOWN) {
                    move = Move.DOWN;
                } else if(code == KeyEvent.VK_W || code == KeyEvent.VK_UP) {
                    move = Move.ROTATION_RIGHT;
                } else if(code == KeyEvent.VK_SPACE) {
                    move = Move.DROP;
                } /*else if(code == KeyEvent.VK_R) { //Only for the applet needed
                    restart();
                } else if(code == KeyEvent.VK_P) {
                    pause();
                } */
                
                moveEvent(move);
            }
        };
        addKeyListener(keyHandler);
        
        jetrisGrid = new JetrisGrid(config.getTetrisGridDimesion());
        jetrisGrid.subscribeEvents(this);
        
        initMenu();

        JPanel mainPanel = new JPanel(new BorderLayout());
        mainPanel.add(statisticsPanel, BorderLayout.WEST);
        mainPanel.add(jetrisGrid, BorderLayout.CENTER);
        infoPanel = new InfoPanel(this);
        mainPanel.add(infoPanel, BorderLayout.EAST);
        mainPanel.add(new CreditsPanel(), BorderLayout.SOUTH);

        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.getContentPane().add(mainPanel, BorderLayout.CENTER);
        pack();
        this.setResizable(false);

        addWindowFocusListener(new WindowFocusListener(){

            @Override
            public void windowGainedFocus(WindowEvent arg0) {
            	isPause = false;
            }

            @Override
            public void windowLostFocus(WindowEvent arg0) {
                isPause = true;
            }
        });
        
        
        setLocation(GuiUtils.getInitialFrameLocation(this));
        setVisible(true);

        jetrisTimerThread = new JetrisTimerThread(this);
        jetrisTimerThread.start();

        nextFigureEvent();
    }