RE:codigo para leer desde archivo txt
Lo tienes todo en el paquete java.io
import java.io.*;
public class a {
public static void main(String args[]) throws Exception {
String s = null;
String texto = \"\";
BufferedReader x = null;
x = new BufferedReader(new FileReader(\"archivo.txt\"));
s = x.readLine();
while (s != null) {
texto += s + \"\\n\";
s = x.readLine();
}
System.out.println(texto);
}
}