Create A Smiley Face using JAVA applets.

Hey Guys. After my last article on JAVA I thought to add some more stuff into it. Last Month I got a problem of making an Smiley face using Applets in JAVA as assignment. Applets are really great tool for such animated programs. So I just thought to share it with you.

1) Click Start > run > type notepad

2) type the following code into it.

 import java.awt.*;
 import java.applet.*;
 public class MyApplet extends Applet
  public void paint(Graphics g)

3) now save it as
4) again open notepad and type the below code

     <head><title>First Applet</title></head>
     <applet code=MyApplet.class width=400 height=400>

5)  save it as xyz.html

6) The Next Step is to run java compiler. Open start > run > type cmd
7) In order to create byte code first go to specific location of your program then type:
8) It is successfully compiled. To see your smiling face :P    in cmd window type:
      appletviewer xyz.html
 Here is a Snapshot.

Note: For any issues related with Program Compiling or JRE take a look at Compile JAVA program . For any queries related with concept of this program ping me on Facebook.

Next Post »