Metrics in japplet: codebase, code, and archive

Source: Internet
Author: User

After creating an applet, You need to compile an HTML file to run the applet.

In the HTML file, configure the following proxy (myapplet.html ):

<HTML lang = "En-us">
<Head>
<Title> applet HTML page </title>
</Head>
<Body>
<APPLET codebase = "E: \ myapplet" code = "test. myapplet. Class"
Width = 350 Height = 200> </APPLET>
</Body>
</Html>

Here, codebase refers to the root category of the Class Object Storage object. For example, the full name of my class object is test. myapplet. class (test is the package name, And myapplet is the class name ),

My test. myapplet. Class is placed under E: \ myapplet.

Code refers to the class file with the full name of example (here, my class name is myapplet and the package name is test, so the generated class full name example should be named test. myapplet. Class)

In this case, after the myapplet. Java file is completed in zookeeper,

You can use the appletviewer command to view the running effect of the program.

The myapplet. Java Runtime is as follows:

Package test;
Import java. AWT. graphics;
Import javax. Swing. japplet;
Import javax. Swing. jbutton;
Public class myapplet extends japplet {
Public void Init (){
System. Out. Print ("=========== init ====================== ");
Add (New jbutton ("applet "));
}
}

The name of the HTML file is myapplet.html.

In the command line, perform the following operations:

E: \ myapplet> javac-D. myapplet. Java
E: \ myapplet> appletviewer myapplet.html

It should be noted that a memory number <Param name = archive value = "...">

The value of archive corresponds to the jar package that may be used in the program before that. Most of these jar packages are placed in the main directory of the Web application program before that,

In this way, the jar package name can be used directly when the value corresponding to the archive is ready.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.