The applet code below reads text files from a JAR file.

Java Code:
import java.applet.*;
import java.io.*;

public class ReadFromJar extends Applet{

  public void init(){
    readTextFromJar("datafile1.txt");
    readTextFromJar("test/datafile2.txt");
    }

  public void readTextFromJar(String s) {
    String thisLine;
    try {
      InputStream is = getClass().getResourceAsStream(s);
      BufferedReader br = new BufferedReader
         (new InputStreamReader(is));
      while ((thisLine = br.readLine()) != null) {
         System.out.println(thisLine);
         }
    }
    catch (Exception e) {
      e.printStackTrace();
    }
  }
}