FileDocCategorySizeDatePackage
TestWrite.javaAPI DocExample813Thu Jun 05 23:06:18 BST 1997None

TestWrite

public class TestWrite extends Applet

Fields Summary
TextArea
ta
Constructors Summary
Methods Summary
public booleanaction(java.awt.Event e, java.lang.Object arg)

		try {
			String fname = "." + File.separator + "testwrite.xxx";
			write("Attempting to write file: "+fname);
			FileOutputStream file = new FileOutputStream(fname);
			new PrintStream( file ).println("Hello...");
			file.close();
			write("Success!");
		} catch ( Exception e2 ) {
			write( "Caught Exception: " + e2 );
			write("Failed to write file...");
		}
		return true;
	
public voidinit()


	   
		setLayout( new BorderLayout() );
		Panel p = new Panel();
		p.add( new Button("Test Write") );
		add( "North", p );
		add( "Center", ta );
	
private voidwrite(java.lang.String s)

		ta.setText( ta.getText() + s + "\n" );