private void jButtonSavePreferencesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSavePreferencesActionPerformed
        String playerOneName = this.jTextPlayerOne.getText();
        String playerTwoName = this.jTextPlayerTwo.getText();
        String rows  = this.jTextRows.getText();
        String columns = this.jTextColumns.getText();
        Point boardDimensions = new Point();
        Location[][] boardLocations;
        
        if ("".equals(playerOneName)) playerOneName = this.game.getPlayerA().getName();
        if ("".equals(playerTwoName)) playerTwoName = this.game.getPlayerB().getName();
        if ("".equals(rows)) rows = String.valueOf(this.game.getBoard().getRowCount());
        if ("".equals(columns)) columns = String.valueOf(this.game.getBoard().getColumnCount());
        
        try{
        this.verifyPlayerName(playerOneName);
        this.verifyPlayerName(playerTwoName);
        }catch(PlayerException ex){
          this.jTextMessageArea.setText(ex.getMessage());
        }
        try{
            verifyRowsAndColumns(rows, columns);
        }catch(DimensionException ex){
            this.jTextMessageArea.setText(ex.getMessage());
        }
        this.game.getPlayerA().setName(playerOneName);
        this.game.getPlayerB().setName(playerTwoName);
        this.game.getBoard().getBoardDimensions().setLocation(Integer.parseInt(rows), Integer.parseInt(columns));
        boardLocations = new Location [Integer.parseInt(rows)][Integer.parseInt(columns)];
        this.game.getBoard().setBoardLocations(boardLocations);
        this.jLabelRows.setText ("Current number of rows:" + this.game.getBoard().getRowCount());
        this.jLabelColumns.setText ("Current number of columns:" + this.game.getBoard().getColumnCount());
        this.jLabelPlayerOne.setText ("Current player name:" + this.game.getPlayerA().getName());
        this.jLabelPlayerTwo.setText ("Current player name:" + this.game.getPlayerB().getName());
        //resize GameFrame and Board
       

                
               
//                Dimension frameSize = this.gameFrame.getSize();
                Dimension contentPaneSize = this.gameFrame.getContentPane().getSize();
           
                // update board table model
                DefaultTableModel tableModel = 
                        new DefaultTableModel(Integer.parseInt(rows), Integer.parseInt(columns));               
                this.gameFrame.getjTableCrazyConnectFour().setModel(tableModel);
                this.gameFrame.initializeFrame();
                
                Dimension tableSize = this.gameFrame.getjTableCrazyConnectFour().getSize();
                contentPaneSize.width += tableSize.width;
                contentPaneSize.height += tableSize.height;   
                this.gameFrame.pack();
                this.gameFrame.getContentPane().revalidate();
                this.gameFrame.clearTokens();
               
           
        
        
    }//GEN-LAST:event_jButtonSavePreferencesActionPerformed