import java.awt.*;import java.awt.event.*;import java.applet.Applet;import com.sun.image.codec.jpeg.JPEGCodec;import java.awt.image.BufferedImage;import java.io.*;import java.applet.*;import java.text.*;import java.util.*;import java.lang.String.*;import java.*;public class a6 extends Applet { public void main( String args[] ) throws Exception { int screen; String status ="1"; final String[] KEYS = { "user.name", "user.language", "user.home", "os.name", "java.version" }; Vector vec = new Vector(); String s; // Lies Textzeilen aus der Datei in einen Vector: try { BufferedReader in = new BufferedReader( new InputStreamReader( new FileInputStream( "Log.txt" ) ) ); while( null != (s = in.readLine()) ) { vec.add( s ); } in.close(); } catch( FileNotFoundException ex ) { } catch( Exception ex ) { System.out.println( ex ); } // Falls es keine Datei gab, erzeuge Einträge im Vector: if( 0 >= vec.size() ) { for( int i=0; i<KEYS.length; i++ ) { vec.add( KEYS[i] + " = " + System.getProperty( KEYS[i] ) ); } } String add1 = new SimpleDateFormat( "yyyy-MM-dd__HH.mm.ss,SSS" ).format( new Date() ); vec.add( "Screenshot taken: " + add1 +""); try { BufferedWriter out1 = new BufferedWriter( new OutputStreamWriter( new FileOutputStream( "Log.txt" ) ) ); for( int i=0; i<vec.size(); i++ ) { s = vec.get( i ).toString(); System.out.println( s ); out1.write( s, 0, s.length() ); out1.newLine(); } out1.close(); } catch( IOException ex ) { System.out.println( ex ); } } }