public Barrillo generarGrano() {

        Random rand = new Random();

        int x = (int) (0.28 * getWidth()) + rand.nextInt((int) (0.42 * getWidth()));
        int y = (int) (0.34 * getHeight()) + rand.nextInt((int) (0.55 * getHeight()));
        int maxAncho = rand.nextInt(20);
        int maxAlto = maxAncho;
        while (comprobarRectangulos(x, y) == true) {
            x = (int) (0.28 * getWidth()) + rand.nextInt((int) (0.42 * getWidth()));
            y = (int) (0.34 * getHeight()) + rand.nextInt((int) (0.55 * getHeight()));
        }
        Barrillo barrillo;
        if (rand.nextInt(100) <= 10) {
            barrillo = new Barrillo(x, y, "grano2", maxAncho, maxAlto, this);
        } else {
            barrillo = new Barrillo(x, y, "grano", maxAncho, maxAlto, this);
        }
        barrillos.add(barrillo);
        repaint(); //vuelve a pintar todos los componentes
        barrillo.start();
        return barrillo;

    }