📄 htmlreader.java
字号:
import javax.swing.*;
import java.io.*;
public class HTMLReader extends JFrame
{
private JEditorPane editor = new JEditorPane();
public HTMLReader()
{
super("HTML Reader");
editor.setContentType("text/html");
editor.setEditable(false);
String name = "file:" + System.getProperty("user.dir")
+ System.getProperty("file.separator") + "sample.html";
try
{ editor.setPage(name); }
catch (IOException ioe)
{ System.err.println("IO Exception: " + ioe); }
getContentPane().add("Center", new JScrollPane(editor));
validate();
pack();
setVisible(true);
}
public static void main(String args[])
{
HTMLReader htmlreader = new HTMLReader();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -