把所以的IE窗口,都关掉,重新打开,我就不信那个没有class的东西还能运行!!!。理由是:所有的IE共一个session和一些存放IE的信息,当你第一次读如.class文件北读入内存,当所有的IE窗口关闭是,才摧毁session和她保持的那些信息。我以前写applet的时候,发现改了有时候等于没改,记住,用IE 调试applet时候, 重新读入applet.class需要关闭所有IE窗口。建议不要用ie调是自己的applet。调试自己的窗体可以用bruceekcel的一个框架: import javax.swing.*; import java.awt.event.*;public class Console { // Create a title string from the class name: public static String title(Object o) { String t = o.getClass().toString(); // Remove the word "class": if(t.indexOf("class") != -1) t = t.substring(6); return t; } public static void setupClosing(JFrame frame) { // The JDK 1.2 Solution as an // anonymous inner class: frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); // The improved solution in JDK 1.3: // frame.setDefaultCloseOperation( // EXIT_ON_CLOSE); } public static void run(JFrame frame, int width, int height) { setupClosing(frame); frame.setSize(width, height); frame.setVisible(true); } public static void run(JApplet applet, int width, int height) { JFrame frame = new JFrame(title(applet)); setupClosing(frame); frame.getContentPane().add(applet); frame.setSize(width, height); applet.init(); applet.start(); frame.setVisible(true); } public static void run(JPanel panel, int width, int height) { JFrame frame = new JFrame(title(panel)); setupClosing(frame); frame.getContentPane().add(panel); frame.setSize(width, height); frame.setVisible(true); } } -------------------------- 搂主,发了两次贴子,我回了两次阿,不好意思。
重新读入applet.class需要关闭所有IE窗口。建议不要用ie调是自己的applet。调试自己的窗体可以用bruceekcel的一个框架:
import javax.swing.*;
import java.awt.event.*;public class Console {
// Create a title string from the class name:
public static String title(Object o) {
String t = o.getClass().toString();
// Remove the word "class":
if(t.indexOf("class") != -1)
t = t.substring(6);
return t;
}
public static void setupClosing(JFrame frame) {
// The JDK 1.2 Solution as an
// anonymous inner class:
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
// The improved solution in JDK 1.3:
// frame.setDefaultCloseOperation(
// EXIT_ON_CLOSE);
}
public static void
run(JFrame frame, int width, int height) {
setupClosing(frame);
frame.setSize(width, height);
frame.setVisible(true);
}
public static void
run(JApplet applet, int width, int height) {
JFrame frame = new JFrame(title(applet));
setupClosing(frame);
frame.getContentPane().add(applet);
frame.setSize(width, height);
applet.init();
applet.start();
frame.setVisible(true);
}
public static void
run(JPanel panel, int width, int height) {
JFrame frame = new JFrame(title(panel));
setupClosing(frame);
frame.getContentPane().add(panel);
frame.setSize(width, height);
frame.setVisible(true);
}
}
--------------------------
搂主,发了两次贴子,我回了两次阿,不好意思。