📄 jeditorpane3.java
字号:
import javax.swing.*;
import javax.swing.event.*;
import java.awt.event.*;
import java.net.*;
import java.io.*;
public class JEditorPane3{
public static void main(String[] args){
JEditorPane editPane = null;
try{
URL address = new URL("http://www.thu.edu.tw");
editPane = new JEditorPane(address);
}catch(MalformedURLException e){
System.out.println("Malformed URL: " + e);
}catch(IOException e){
System.out.println("IOException: " + e);
}
editPane.setEditable(false);
JFrame f = new JFrame("JEditorPane3");
f.setContentPane(new JScrollPane(editPane));
f.setSize(200,250);
f.show();
f.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
}//end of main()
}//end of class JEditPane3
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -