シンプルで実用的なのJEditorPaneクラス

package lianxi;
import java.io.*;
import java.net.*;
import java.util.Scanner;

import javax.swing.*;
public class lianxi {
public static void main(String []args) {
JFrame f=new JFrame("标题");
f.setSize(200, 200);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JEditorPane editPane = null;
editPane = new JEditorPane();// 构造一个空的JEditorPane
try {
	editPane.setPage("https://www.csdn.net/");
	editPane.setEditable(false);
	f.add(editPane);
} catch (IOException e) {
	// TODO 自动生成的 catch 块
	e.printStackTrace();
}
}
}

在这里插入代码片
公開された130元の記事 ウォン称賛16 ビュー30000 +

おすすめ

転載: blog.csdn.net/feiqipengcheng/article/details/104727822