如果不去掉的话,应该怎么改呢?
import java.awt.*;
import javax.swing.*;
import java.net.*;
import java.io.*;
public class JTextPaneDemo extends JFrame{ //就是这个public
public JTextPaneDemo(){
JTextPane tp = new JTextPane();
int v = ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
int h = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
JScrollPane jsp = new JScrollPane();
Container cp = getContentPane();
cp.add(jsp);
setSize(400,300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
show();
try{
URL myadd = new URL("http://www.163.com");
tp.setPage(myadd);
}catch(Exception e){
e.printStackTrace();
}
}
public static void main(String[] args){
JTextPaneDemo tpd = new JTextPaneDemo();
}
}