📜  使用 Java 动态将 html 写入文件 - Html 代码示例

📅  最后修改于: 2022-03-11 14:52:54.358000             🧑  作者: Mango

代码示例1
import java.awt.Desktop;
import java.io.*;

class ShowGeneratedHtml {

    public static void main(String[] args) throws Exception {
        File f = new File("source.htm");
        BufferedWriter bw = new BufferedWriter(new FileWriter(f));
        bw.write("

Blah, Blah!

"); bw.write(""); bw.write(""); bw.close(); Desktop.getDesktop().browse(f.toURI()); } }