Thursday, 11 April 2013

Java Applets first step using netbeans IDE

Java Applets first step using netbeans IDE.
https://netbeans.org/kb/docs/web/applets.html
http://docs.oracle.com/javase/tutorial/uiswing/components/applet.html
http://www.javakode.com/applets/
Hai all ,

Now we learn about applet first step using netbeans IDE.

use netbeans newproject ->Java->Java Class Library ->HelloApplet

so by this route we make a Java Project first.

After that we need to make some route for applet settings .


Just read below terms :


Creating or Importing an Applet Source File

In this section, you create your first applet. Possibly, you already have an applet and, in this case, you can use the instructions below to import it into the IDE.

Create the Java project from scratch or from existing sources

  1. Choose File > New Project (Ctrl-Shift-N). Under Categories, select Java.
  2. Choose one of the following:
    • If you are creating a new applet source file, select Java Class Library under Projects. Click Next.
    • If you want to import an applet source file, select Java Project with Existing Sources. Click Next. Specify the file's location in the Source Packages Folder text box.
  3. Under Project Name, type HelloApplet. Change the Project Location to any folder on your computer.
  4. Click Finish. If you imported an applet source file, run it.

Create the applet source file

  1. Right-click the HelloApplet project and choose Properties to open the Properties window.
  2. Select the desired Source / Binary Format for the project and click OK.
    Note: For example, if you choose JDK 6 the applet might not run on machines that have an older version of the JRE or Java browser plugin.
  3. Right-click the HelloApplet project node in the Projects window and select New > Other (Ctrl-N).
  4. Under Categories, select Java. Under File Types, select Applet.
    Alternatively, if you want to visually design your applet, select Swing GUI Forms > JApplet Form.
    Click Next.
  5. Under Class Name, type MyApplet. Under Package, type org.me.hello.
  6. Click Finish.
    The IDE creates the applet source file in the specified package. The applet source file opens in the Source editor.
  7. Define your applet class by copying and pasting the following code over the existing default code:

 package org.me.hello;

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

     public class MyApplet extends Applet {
         @Override
         public void paint(Graphics g) {
             g.drawString("Hello applet!", 50, 25);
         }
     }
                


woowwwww---------My Applet now created :)


This is the my applet code :

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.me.hello;

import java.applet.Applet;

/**
 *
 * @author backup
 */
public class MyApplet extends Applet {

    /**
     * Initialization method that will be called after the applet is loaded into
     * the browser.
     */
    public void init() {
        // TODO start asynchronous download of heavy resources
    }
    // TODO overwrite start(), stop() and destroy() methods
}

3 comments:

  1. Excellent blog I visit this blog it's really awesome. The important thing is that in this blog content written clearly and understandable. The content of information is very informative. We are also providing the best services click on below links to visit our website.
    Oracle Fusion HCM Training
    Workday Training
    Okta Training
    Palo Alto Training
    Adobe Analytics Training

    ReplyDelete