Having dificulties with a load method

basically i have a read all lines LineIO method to read .txt files. after doing this i need to store them into my arraylist. how do i do this?any help appreciated.
[177 byte] By [Akark] at [2007-11-26 12:17:52]
# 1
Split at newline character.Kaj
kajbj at 2007-7-7 14:55:58 > top of Java-index,Archived Forums,Socket Programming...
# 2
Read a line, add to list, repeat...What exactly is your problem? i don't seem to understand it...
CeciNEstPasUnProgrammeur at 2007-7-7 14:55:58 > top of Java-index,Archived Forums,Socket Programming...
# 3

readLine from BufferedReader untill null returned. Add each line to array list. Is this what you need?

import java.io.BufferedReader;

import java.io.File;

import java.io.FileReader;

import java.util.ArrayList;

public class ReadToArrayList {

public static void main(String... args) throws Exception {

if (args.length < 1)

throw new IllegalArgumentException("Arguments: file");

BufferedReader reader = new BufferedReader (

new FileReader( new File(args[0])) );

// Read lines

ArrayList<String> lines = new ArrayList<String>();

try {

String line = null;

while((line = reader.readLine()) != null)

lines.add(line);

} finally {

reader.close();

}

// Process lines example

for(String line : lines)

System.out.println("> " + line);

}

}

a3cchan at 2007-7-7 14:55:58 > top of Java-index,Archived Forums,Socket Programming...
# 4

well i have this piece of code which follows a split text body part.

newMessage = newTextMessage(splitText[0], splitText[1], splitText[2], splitText[3]);

textMessages.add(newMessage);

}

which would work as far as i can work it out, however i get an error;

"cannot find symbol - variable new message"

this implies i havnt declared the variable newMessage yeah? but i already have a method adding a method to an array list with .add(newMessage) being used.

its really confused me.

Akark at 2007-7-7 14:55:58 > top of Java-index,Archived Forums,Socket Programming...