Applet code tags and class files

前端 未结 1 1995
囚心锁ツ
囚心锁ツ 2021-01-22 09:42

I just started writing Applets and I had some questions about the HTML applet tags with packages, and class files.

I\'ll start with packages. I\'ve been using Netbeans t

1条回答
  •  借酒劲吻你
    2021-01-22 09:53

    
    
    
    

    As to the applet element for a myClass applet class in the myPackage package.

    1) An applet element should have spaces between the attributes (I'm not sure if that is part of the W3C recommendation, but it just looks weird).

    
    
    
    

    2) The code attribute should be the fully qualified name of the class, which means:

    
    
    
    

    3) With no archives and no codebase specified, the JRE would look for the class in the myPackage sub-directory of the directory from which the HTML is loaded. E.G. if the HTML is called applet.html and is located at:

    • http://oursite.com/product/applet.html

    The class would need to be located at:

    • http://oursite.com/product/myPackage/myCLass.class

    Once you think you have the applet class correct, try fetching it using the address in the browser address bar. If the class is not offered for download, the JRE won't be able to load it either.

    0 讨论(0)
    提交回复
    热议问题