简体   繁体   中英

How to monitor the error log of a Java Applet running in a browser?

I have written a Java applet that runs perfectly in the applet viewer but when I try to run it in the browser it will not initialize, instead I'm stuck at the gray screen of death.

<html><body>
<applet code=main.Main.class
    width=800 height=600>
</applet></body></html>

Java File main/Main.java

package main;

//etc some imports here

public class Main extends JApplet implements Observer {

    @Override
    public void init() {
       // do some stuff here
    }

    //.......
}

I have also tried running some simple applets in the browser and they work, so I do not know why doesn't this one work.

Is there any way I can monitor the error log from the browser? So I might see where does this applet fails?

appletviewer中启动applet,或者从shell启动浏览器以读取错误消息。

Running the browser in the console will display all the errors

Apparently an external jar was not included in the browser

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM