FileWriter using netbeans not working -


here code print current time in file using netbeans not working.

private void jbutton2actionperformed(java.awt.event.actionevent evt) {                                             // todo add handling code here:    // l1.settext(randomint+"cleaned files");    l1.settext("all viruses cleaned");    string timestamp = new simpledateformat("yyyymmdd_hhmmss").format(calendar.getinstance().gettime());    filewriter filewriter = null;    try {        string content = "hello! java-buddy :)";        filewriter f1=new filewriter("filename.txt");        f1.write(timestamp);        f1.close();    } catch (ioexception ex) {        system.out.println(ex.getmessage());        // logger.getlogger(writestringtofile.class.getname()).log(level.severe, null, ex);    } }   


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -