📄 filebean.java
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package del;/** * * @author Sunyu */import java.io.*;import java.util.*;import java.text.SimpleDateFormat;public class FileBean implements Serializable { public FileBean() { } ; public boolean writeStr(String s) { try { Calendar c = Calendar.getInstance(Locale.CHINESE); SimpleDateFormat simpleDateTimeFormat = new SimpleDateFormat(" yyyyMMdd-HH:mm:ss "); String sname = simpleDateTimeFormat.format(c.getTime()); FileWriter fw = new FileWriter("E:\\diary\\diary.txt",true); fw.write(s + sname + "\r\n"); fw.close(); return true; } catch (IOException ioe) { ioe.printStackTrace(); } return false; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -