private String[] readTextField1() {
        int size = 0;
        String[] s;
        String temp = jTextArea1.getText();
        char c = temp.charAt(temp.length()-1);
        StringReader sr = new StringReader(temp);
        try {
            LineNumberReader lr = new LineNumberReader(sr);
            lr.skip(Long.MAX_VALUE);//skip to the end of the file
            size = ((int)c == 10) ? (lr.getLineNumber() - 1) : lr.getLineNumber();//if last char is a new line character substract the last line in determining the size
        } catch (Exception e) {
            System.out.println(e);
        }
        sr.close();//close and reopen file to skip back to the beginning
        s = new String[size+1];
        sr = new StringReader(temp);
        BufferedReader br = new BufferedReader(sr);
        try {
            for (int i = 0; i < s.length; i++) {//read each line and store in array of strings
                    s[i] = br.readLine();
            }
        } catch (Exception e) {
            System.out.println(e);
        }
        return s;
    }