public void updateMatrix(File file) {
        System.out.println ("actualizando matriz");
        FileReader fr = null;
        //BufferedImage TempBI = new BufferedImage(Columns * Dime_200819312.DimeSize, Rows * Dime_200819312.DimeSize, BufferedImage.TYPE_INT_RGB);
        BufferedImage TempBI = new BufferedImage(Columns * Bubble.DimeSize, Yit, BufferedImage.TYPE_INT_RGB);
            try {
                //Rows+1 por si el archivo ya tiene ocupado las 20 posiciones
                DimeMatrix = new Bubble[Rows+1][Columns];
                fr = new FileReader(file);
                input = new BufferedReader(fr);
                //System.out.println("This is Yi" + Yit);
                
                g2d = TempBI.createGraphics();
                g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);//antialiasing
                Bubble.resetBubbles();
                switch (scene) {
                    case 1:
                        startScene1();
                        break;
                    case 2:
                        startScene2();
                        break;
                    default:
                        startScene3();
                }
            } catch (FileNotFoundException fileNotFoundException) {
                System.err.println("Error opening file.");
                fileNotFoundException.printStackTrace();
                //System.exit( 1 );
            } catch (NoSuchElementException elementException) {
                System.err.println("No hay archivo");
                elementException.printStackTrace();
            } catch (IllegalStateException stateException) {
                System.err.println("Error de lectura");
                stateException.printStackTrace();
            } catch (IOException e) {
                System.out.println("Error IOException");
                e.printStackTrace();
            } finally {
                try {
                    if (input != null) {
                        input.close();
                    }
                    if (fr != null) {
                        fr.close();
                    }
                } catch (IOException e) {
                    System.out.println("No se pudo cerrar el archivo");
                    e.printStackTrace();
                }
                matrix = TempBI;
                ballCount = Bubble.getBubbleCount();
                g2d.dispose();
                repaint();
            }
    }