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..."); }
JButton button = new JButton("Test Write"); button.addActionListener( this ); JPanel p = new JPanel(); p.add( button ); getContentPane().add( "North", p ); getContentPane().add( "Center", new JScrollPane(ta) );
ta.append( s + "\n" );