Creating JApplet from JBUILDER
by Jenny Chang

California State University, Los Angeles
July 2, 2003

 

JBuilder Getting Started

The following is a general guideline in creating a JApplet from JBuilder.  Please note that the following steps may vary depending on the version of JBuilder that you use.

 

  1. Open JBuilder
  2. Click File à New…
  3. The Object Gallery dialog will appear.  Select the “Web” tab if you are using JBuilder 6 Enterprise, or the “New” tab if you are using JBuilder 6 Personal version.
  4. Click on the applet icon and click OK.



  5. The Project Wizard dialog will appear.  Type the name for your project in the Name field (e.g. HelloWorldApplet)



  6. Click Next>
  7. Click Next> again
  8. On the last step, click on the Text field next to the Label field and type the information as shown in the following screenshot while replacing my name with your own name:


 

  1. Click Finish
  2. The Applet Wizard dialog will appear.  Type the Package name and Class name.  Then click Next>



  3. Click Next>
  4. Click Finish
  5. Delete the code that is automatically generated for you inside the class.  You should have something that looks like the following figure:

 

 

  1. Your class should extend or inherit from JApplet.  Thus, rename Applet to JApplet.
  2. Remove the imported classes, and import the following classes instead:

 

import java.awt.Graphics;

import javax.swing.JApplet;

 

  1. Your sourcecode should appear as follows:

 

 

  1. Create the init and paint method for your HelloWorld class.



  2. Congratulations, you have successfully created a JApplet!