import java.applet.*;
import java.io.*;

public class fileio extends Applet
{

    public void init() 
    {
	FileOutputStream f = null;
	try {
	    String fname = getParameter("filename");
	    if (fname == null)
		fname = "./fileio.test";
	    System.out.println("Opening " + fname + " for write access");
	    f = new FileOutputStream(fname);
	    PrintStream p = new PrintStream(f);
	    p.println("Hello, World\n");
	    f.close();
	} catch (Throwable t) {
	    System.out.println(t.getMessage());
	    t.printStackTrace();
	} 
    }
}

