can't have a file larger than 10*10 characters
<p>what makes it only be able to input 10*10 text files</p>

<pre><code>package game;

import java.io.*;
import java.util.*;

public class Level {

static public void main(String[] args) throws IOException {
    File f = new File("Data1.txt");
    int[][] m = Map(f);
    for (int x = 0; x &lt; m.length; x++) {
        for (int y = 0; y &lt; m[x].length; y++) {
            System.out.print(m[x][y]);
        }
        System.out.println();
    }
}

public static int[][] Map(File f) throws IOException {

    ArrayList line = new ArrayList();
    BufferedReader br = new BufferedReader(new FileReader(f));
    String s = null;
    while ((s = br.readLine()) != null) {
        line.add(s);
    }
    int[][] map = new int[line.size()][];
    for (int i = 0; i &lt; map.length; i++) {
        s = (String) line.get(i);
        StringTokenizer st = new StringTokenizer(s, " ");
        int[] arr = new int[st.countTokens()];
        for (int j = 0; j &lt; arr.length; j++) {
            arr[j] = Integer.parseInt(st.nextToken());
        }
        map[i] = arr;
    }
    return map;
}
}
</code></pre>

<p>if i put in a text file that is 
10*10 or less characters it works
otherwise it comes out with a numberformatexception </p>

<p>fixed</p>

<p>package game;</p>

<pre><code>import java.io.*;
import java.util.*;

public class Level {

    static public void main(String[] args) throws IOException {
        File f = new File("Data1.txt");
        int[][] m = Map(f);
        for (int x = 0; x &lt; m.length; x++) {
            for (int y = 0; y &lt; m[x].length; y++) {
                System.out.print(m[x][y]);
            }
            System.out.println();
        }
    }

    public static int[][] Map(File f) throws IOException {

        ArrayList line = new ArrayList();
        BufferedReader br = new BufferedReader(new FileReader(f));
        String s = null;
        while ((s = br.readLine()) != null) {
            line.add(s);
        }
        int[][] map = new int[line.size()][];
        for (int i = 0; i &lt; map.length; i++) {
            s = (String) line.get(i);
            char[] m = s.toCharArray();
            String[] n = new String[m.length];
            for (int t = 0; t&lt;m.length;t++)
            {
                n[t] = ""+m[t];
            }

            int[] arr = new int[m.length];
            for (int j = 0; j &lt; arr.length; j++) {
                arr[j] = Integer.parseInt(n[j]);
            }
            map[i] = arr;
        }
        return map;
    }
}
</code></pre>
