我有WriteFile
有WriteToFile
写入String
word文档的方法的类.
WriteFile data=new WriteFile("C:/test3.doc",true); data.writeToFile(user.saxeli+" "+user.gvari+" "+user.asaki+" "+user.swori);
如何String
用粗体和下划线样式写"test3.doc"?
这是WriteFile类:
import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; public class WriteFile { private String path; private boolean append=true; public WriteFile(String path,boolean append){ this.path=path; this.append=append; } public void writeToFile(String text) throws IOException{ FileWriter write=new FileWriter(path,append); PrintWriter print_line= new PrintWriter(write); print_line.printf("%s"+"%n", text); print_line.close(); } }
ljgw.. 6
看看Apache POI.该库可以写入Microsoft Word文件并使用粗体和下划线(字体)样式.
看看Apache POI.该库可以写入Microsoft Word文件并使用粗体和下划线(字体)样式.