关于"javal.net.*" 初学,初学
小弟刚才在编译下面这段程序的时候,出现了这个错误:"Could not find the main class. Program will exit."
我快急死了,什么是"main class",我做的是小应用程序呀.5555555555555555555~~~~~~~~
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.net.*;
public class Applet1
extends Applet
implements ActionListener {
Button button;
URL url;
TextField text;
public void init() {
text = new TextField(18);
button = new Button("确定");
add(new Label("请输入网址:"));
add(text);
add(button);
}
public void actionPerformed(ActionEvent e) {
if (e.getSource() == button) {
try {
url = new URL(text.getText().trim());
}
catch (MalformedURLException g) {
text.setText("不正确的URL:" + url);
}
getAppletContext().showDocument(url);
}
}
}
各位大虾,快,快呀!!!!!!!!!!