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;
setLayout( new BorderLayout() ); Panel p = new Panel(); p.add( new Button("Test Write") ); add( "North", p ); add( "Center", ta );
ta.setText( ta.getText() + s + "\n" );