简体   繁体   中英

How to update a local java applet to test in browser

So I have this applet on my computer, and it runs fine on Eclipse.

This is someone else's project, and they created a webpage which runs the applet. I am trying to update the code to test it, I open the HTML page from my computer, which I am assuming loads the updated .java file?

But this is not working, the loaded applet has not been updated. Do I have to convert the .java file to something else for the browser to load it? I am inexperienced with making java work with browsers. And I already have a .html file which somehow loads, I have tried reading it but I don't see any code which calls myFile.java

The html page does not load .java (java source code) file. It loads a compiled java file.

After updating the .java file, export it with Export->Jar.

Html file should have something like following.

<applet code = 'AppletClassName' 
      archive = 'NameOfExportedJarFile.jar', 
      width = 500, 
      height = 500 />

See the answer by medopal in How to build a java applet?

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