Is any way to convert a 开发者_开发知识库java applet code to java script?
Not really, no. They're different languages with different libraries.
If you want to develop for the client-side Web with Java, have a look at GWT
I don't think there is a good way to do so. Please remember: Java and JavaScript are two entirely different technologies. Don't mix them up.
Not directly and without effort as far as I know. However people have ported many things to HTML/JS, like Quake 2 on GWT. So you could invest some time and step into the code and port it with GWT. Advantages of going with GWT arise from the fact that your applet is in Java language, which is the same language you use for GWT. Here is a list of what you can use in your code: GWT JRE Emulation
No. Google Web Toolkit (GWT) is what you might need. I recommend book GWT In Practice 2008
12 years later there is now a tool called "JSweet" which claims to do exactly that: converting Java code to JavaScript: https://www.jsweet.org/
There is also a blog post from 2019 of someone using JSweet to convert some Java Applets to JavaScript: https://www.lprp.fr/2019/08/jsweet-convert-applets-to-javascript/
精彩评论