Java Simple applet app creation.

Source: Internet
Author: User

Recently because of homework, we need to use Java to do some drawing applications, and displayed on the Web page. So, I'm doing some demonstrations here. (There is a mistake, please forgive me)

First, you can have the IDE write the good one package first,

Here I put the required. class files into this package.

Note that in Java applet Chinese, I introduced this package import shapepage.j_circle;

, this is important, if this goes wrong, it will cause the run to fail, and in the graphics class above, I have to declare the package they belong to.

/** To change this template, choose Tools | Templates * and open the template in the editor. */Importshapepage.j_circle;Importjava.applet.*;Importjava.awt.*;/** * * @authorAdministrator*/ Public classJextendsApplet { Publicj_circle C; @Override Public voidinit () {setbackground (color.yellow); C=NewJ_circle (100,100,2); } @Override Public voidPaint (Graphics g) {c.paint (g); }}

Finally, use CMD.

Most run structure:

Java Simple applet app creation.

Related Article

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.