jeditorpane3.java
来自「100个java小例子」· Java 代码 · 共 32 行
JAVA
32 行
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.chinamor.cn.net");
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 + =
减小字号Ctrl + -
显示快捷键?