1. #1
    Unregistered

    How to create a JAVA Applet?

    hello sir/madam
    how to create applet





  2. Related:
  3. #2
    ramakrishna2
    Join Date
    Sep 2011
    Posts
    22

    Re: How to create a JAVA Applet?

    My dear friend...
    applet is a small java program and you can create with using internet or without using internet by using local applet
    CREATING AN APPLET

    There are 5 steps to create an applet by using the methods
    *initilization-in this we use init() method
    public void init()
    {
    --------
    -------(action)
    }
    *running state-
    public void start()
    {
    -------
    -------(action)
    }
    *idle state-
    public void stop()
    {
    ------
    -----(action)
    }
    *dead state
    public void destroy()
    {
    -----
    -----(action)
    }
    *display state-
    public void paint(Graphics g)
    {
    ----
    -----(display statements)
    }
    these are the steps to create java applet
    should be inherited from the package
    *java.applet.Applet;
    *java.awt.*;




  4. #3
    venkataprakash
    Join Date
    Apr 2011
    Location
    chennai.
    Posts
    1,275

    Re: How to create a JAVA Applet?

    Applet is a special aspect in the java program that is designated to transmitted over the Internet and automatically executed by the web browsers.

    Don't worry I am provide the simple applet program.

    import java.awt.*;
    import java.applet.*;

    public class Simple Applet extends Applet
    {
    public void paint(Graphics g)
    g.drawString("EducationCareer" ,20,20);
    }

    This is a simple applet program and like this you can create many applet.If you need to complete details of the Applet Buy the complete Reference new version.There is a brief Explanation about the applet.



    Buy this book.It is useful for you and there is a chapter 13(i.e mentioned the applet fundamental that means the book tell how to create applets and there meaning.

  5. #4
    sanjeev borikar
    Join Date
    Aug 2011
    Location
    hyderabad
    Posts
    899

    Re: How to create a JAVA Applet?

    hello
    A Java applet is a small program written in Java source code. Java is an object-oriented programming language suited to client-server architectures, or the Web. An applet is a program with a limited function. A Java applet can be positioned in a remote computer, a server or your own computer. Java applets can be embedded in hypertext markup language (HTML) code and are executed by the browser.

  6. #5
    chada.rajashekar
    Join Date
    Oct 2011
    Posts
    287

    Re: How to create a JAVA Applet?

    HELLO....

    An applet is a program written in java programming language and embedded within HTML page.

    . It run on the java enabled web browser such as Netscape navigator or Internet Explorer.


    Here is the java code of program :

    import java.applet.*;
    import java.awt.*;

    public class FirstApplet extends Applet{
    public void paint(Graphics g){
    g.drawString("Welcome in Java Applet.",40,20);
    }
    }


    In the above you will see, how to write an applet program.
    Java source of applet is then compiled into java class file and we specify the name of class in the applet tag of html page.
    The java enabled browser loads class file of applet and run in its sandbox.

    -GOOD LUCK--

  7. #6
    rajini444
    Join Date
    Nov 2011
    Posts
    176

    Re: How to create a JAVA Applet?

    An applet is a program written in java programming language and embedded within HTML page.

    . It run on the java enabled web browser such as Netscape navigator or Internet Explorer.


    Here is the java code of program :

    import java.applet.*;
    import java.awt.*;

    public class FirstApplet extends Applet{
    public void paint(Graphics g){
    g.drawString("Welcome in Java Applet.",40,20);
    }
    }


    In the above you will see, how to write an applet program.
    Java source of applet is then compiled into java class file and we specify the name of class in the applet tag of html page.
    The java enabled browser loads class file of applet and run in its sandbox.

  8. #7
    Rahul kuntala
    Join Date
    Aug 2011
    Location
    India
    Posts
    1,394

    Re: How to create a JAVA Applet?

    Quote Originally Posted by Unregistered View Post
    hello sir/madam
    how to create applet
    Hi Friend


    First of all I want to clarify your doubts regarding the applet then I will give you the applet code ...!

    What is an Applet ?

    Applet is nothing but a simple code which runs on the web browser such as IE,Mozilla or Google chrome etc..!!! Applets don't have a main() method..!! All applets inherit the Superclass 'Applet'. All Applets must import java.applet and java.awt Packages..

    There are 2types of Applets:
    Local Applet
    Remote Applet


    Being a Java lover I would suggest you the following simple code using Applets...!! Don't be panic, it is a simple code if you know a little bit of java concepts...!!

    Sample Java Applet:


    import java.applet.Applet;
    import java.awt.Graphics;
    import java.awt.Color;

    public class SimpleApplet extends Applet{

    String text = "I'm a simple applet";

    public void init() {
    text = "I'm a simple applet";
    setBackground(Color.cyan);
    }
    public void start() {
    System.out.println("starting...");
    }
    public void stop() {
    System.out.println("stopping...");
    }
    public void destroy() {
    System.out.println("preparing to unload...");
    }
    public void paint(Graphics g){
    System.out.println("Paint");
    g.setColor(Color.blue);
    g.drawRect(0, 0,
    getSize().width -1,
    getSize().height -1);
    g.setColor(Color.red);
    g.drawString(text, 15, 25);
    }
    }


    output will be:



    There are two ways to run the applet:
    1. Executing an applet within a Java-compatible web browser.
    2. Executing an applet using 'applet viewer' ..!


    Important:

    To execute an applet - the below mentioned applet code must be written in the notepad or HTML...!!
    <applet code = "FirstApplet" width = 300 height = 100>
    </applet>



    I hope this post helped at least some how..!!

    Reference Books for JAVA:

    • The Java Handbook by Patrick Naughton, Michael Morrison
    • The Java Virtual Machine Specification
    • The Java Language Specification by James Gosling , Bill Joy, Guy Steele
    • Java in a Nutshell: A Desktop Quick Reference for Java Programmers
    • The Java AWT Reference
    • The Java Language Specification
    • Java 7th edition by TMH publications (This book really helps you!!)



    All the best

    @ Rahul Kuntala

  9. #8
    sunny12
    Join Date
    Aug 2011
    Posts
    501

    Re: How to create a JAVA Applet?

    hello
    A Java applet is a small program
    written in Java source code. Java
    is an object-oriented
    programming language suited to
    client-server architectures, or the
    Web. An applet is a program with a
    limited function. A Java applet
    can be positioned in a remote
    computer, a server or your own
    computer. Java applets can be
    embedded in hypertext markup
    language (HTML) code and are
    executed by the browser.

  10. #9
    mahen456
    Join Date
    Oct 2011
    Posts
    192

    Re: How to create a JAVA Applet?

    A Java applet is a small program
    written in Java source code. Java
    is an object-oriented
    programming language suited to
    client-server architectures, or the
    Web.

    example:

    import java.awt.*;
    import java.applet.*;

    public class Simple Applet extends Applet
    {
    public void paint(Graphics g)
    g.drawString("EducationCareer" ,20,20);
    }

  11. #10
    RAPIDEX
    Join Date
    Nov 2011
    Posts
    123

    Re: How to create a JAVA Applet?

    dear friend,

    it's easy to create an applet by java.you can follow the program in bellow

    import java.applet.*;//you have to import the packages from java folder
    import java.awt.*;

    public class FirstApplet extends Applet{
    public void paint(Graphics g){
    g.drawString("RAPIDEX",40,20);
    }
    }

  12. #11
    litunu
    Join Date
    Nov 2011
    Posts
    327

    Re: How to create a JAVA Applet?

    It run on the java enabled web browser such as Netscape navigator or Internet Explorer.


    Here is the java code of program :

    import java.applet.*;
    import java.awt.*;

    public class FirstApplet extends Applet{
    public void paint(Graphics g){
    g.drawString("Welcome in Java Applet.",40,20);
    }
    }


    In the above you will see, how to write an applet program.
    Java source of applet is then compiled into java class file and we specify the name of class in the applet tag of html page.
    The java enabled browser loads class file of applet and run in its sandbox

  13. #12
    pmg1009
    Join Date
    Nov 2011
    Posts
    391

    Re: How to create a JAVA Applet?

    An applet is a program written in java programming language and embedded within HTML page.

    . It run on the java enabled web browser such as Netscape navigator or Internet Explorer.

    Here is the java code of program :

    import java.applet.*;
    import java.awt.*;

    public class FirstApplet extends Applet{
    public void paint(Graphics g){
    g.drawString("Welcome in Java Applet.",40,20);
    }
    }


    In the above you will see, how to write an applet program.
    Java source of applet is then compiled into java class file and we specify the name of class in the applet tag of html page.
    The java enabled browser loads class file of applet and run in its sandbox.

  14. #13
    sai baba
    Join Date
    Nov 2011
    Posts
    102

    Re: How to create a JAVA Applet?

    An applet is a program written in
    java programming language and
    embedded within HTML page.
    . It run on the java enabled web
    browser such as Netscape navigator
    or Internet Explorer.
    Here is the java code of program :
    import java.applet.*;
    import java.awt.*;
    public class FirstApplet extends
    Applet{
    public void paint(Graphics g){
    g.drawString("Welcome in Java
    Applet.",40,20);
    }
    }
    In the above you will see, how to
    write an applet program.
    Java source of applet is then
    compiled into java class file and
    we specify the name of class in the
    applet tag of html page.
    The java enabled browser loads
    class file of applet and run in its
    sandbox.
    -GOOD LUCK--

  15. #14
    path
    Join Date
    Jan 2012
    Posts
    241

    Re: How to create a JAVA Applet?

    Here is the java code of program :

    import java.applet.*;
    import java.awt.*;
    public class FirstApplet extends Applet{
    public void paint(Graphics g){
    g.drawString("Welcome in Java Applet.",40,20);
    }
    }
    In the above you will see, how to write an applet program.
    Java source of applet is then compiled into java class file and we specify the name of class in the applet tag of html page.

  16. #15
    jayanthcena
    Join Date
    Jan 2012
    Location
    Chennai
    Posts
    19

    Re: How to create a JAVA Applet?

    public void init()
    {
    --------
    -------(action)
    }
    *running state-
    public void start()
    {
    -------
    -------(action)
    }
    *idle state-
    public void stop()
    {
    ------
    -----(action)
    }
    *dead state
    public void destroy()
    {
    -----
    -----(action)
    }
    *display state-
    public void paint(Graphics g)
    {
    ----
    -----(display statements)
    }

  17. #16
    VEENAMBRUTHA
    Join Date
    Jan 2012
    Posts
    829

    Re: How to create a JAVA Applet?

    Quote Originally Posted by Unregistered View Post
    hello sir/madam
    how to create applet
    First of all we will know about the applet.
    >>>>>> An applet is a program written in java programming language and embedded within HTML page. It run on the java enabled web browser such as Netscape navigator or Internet Explorer.

    In this example you will see, how to write an applet program. Java source of applet is then compiled into java class file and we specify the name of class in the applet tag of html page. The java enabled browser loads class file of applet and run in its sandbox.

    Here is the java code of program :

    import java.applet.*;
    import java.awt.*;

    public class FirstApplet extends Applet{
    public void paint(Graphics g){
    g.drawString("Welcome in Java Applet.",40,20);
    }
    }

    Here is the HTML code of the program:

    <HTML>
    <HEAD>
    </HEAD>
    <BODY>
    <APPLET ALIGN="CENTER" CODE="FirstApplet.class" WIDTH="800" HEIGHT="500"></APPLET>
    </BODY>
    </HTML>

    VIDEO FOR CREATING JAVA APPLET:


    GOOD LUCK !!!

+ Reply to Thread

Quick Reply Any Question?