<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=Netbeans%2FC2%2FIntegrating-an-Applet-in-a-Web-Application%2FEnglish</id>
		<title>Netbeans/C2/Integrating-an-Applet-in-a-Web-Application/English - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=Netbeans%2FC2%2FIntegrating-an-Applet-in-a-Web-Application%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Netbeans/C2/Integrating-an-Applet-in-a-Web-Application/English&amp;action=history"/>
		<updated>2026-04-09T00:09:41Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Netbeans/C2/Integrating-an-Applet-in-a-Web-Application/English&amp;diff=216&amp;oldid=prev</id>
		<title>Chandrika: Created page with '[http://spoken-tutorial.org/wiki/images/8/88/Integrating_an_Applet_in_a_Web_Application_-_Resources.zip Resources for &quot;Integrating Applets in a Web Application&quot;]   {| style=&quot;bord…'</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Netbeans/C2/Integrating-an-Applet-in-a-Web-Application/English&amp;diff=216&amp;oldid=prev"/>
				<updated>2012-11-27T12:37:12Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;[http://spoken-tutorial.org/wiki/images/8/88/Integrating_an_Applet_in_a_Web_Application_-_Resources.zip Resources for &amp;quot;Integrating Applets in a Web Application&amp;quot;]   {| style=&amp;quot;bord…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[http://spoken-tutorial.org/wiki/images/8/88/Integrating_an_Applet_in_a_Web_Application_-_Resources.zip Resources for &amp;quot;Integrating Applets in a Web Application&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border-top:0.002cm solid #000000;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| &amp;lt;center&amp;gt;'''Visual Cue'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:0.002cm solid #000000;padding:0.097cm;&amp;quot;| &amp;lt;center&amp;gt;'''Narration'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| Slide 1&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Hi everyone&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Welcome to the tutorial on Integrating an Applet in a Web App&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The application that you build in this tutorial shows you how to build and deploy applets in the Netbeans IDE.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| Slide 2&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:0.035cm solid #000000;padding:0.097cm;&amp;quot;| If this is the first time you are using Netbeans, please view the tutorials,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Introduction to Netbeans, to get started with the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also you view the tutorials Developing Web Applications and Designing GUIs on Netbeans &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
to get familiarised with the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All the above tutorials can be viewed on [http://www.spoken-tutorials.org/ www.spoken-tutorials.org].&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| Slide 3&lt;br /&gt;
&lt;br /&gt;
System Setup&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:0.035cm solid #000000;padding:0.097cm;&amp;quot;| For this demonstration, I am using the Linux Operating System Ubuntu v11.04 and Netbeans IDE v7.0.1&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| Slide 4&lt;br /&gt;
&lt;br /&gt;
Lesson Outline&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:0.035cm solid #000000;padding:0.097cm;&amp;quot;| '''In this tutorial''', we will&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Create an Applet&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run the Applet; and&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Embed the applet in a web application&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let us now launch the IDE.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| Switch to Netbeans Window&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:0.035cm solid #000000;padding:0.097cm;&amp;quot;| ''Creating the Java Project''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Choose '''File&amp;gt;New Project'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Under '''Categories''', select '''Java'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Under '''Projects''', select '''Java Class Library'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Under '''Project Name ''', type '''SampleApplet'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Set the Project Location to any folder on your computer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Creating the Applet Source File''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Right-Click the '''SampleApplet '''project &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and choose '''Properties '''to open the Properties window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Select the desired '''Source/Binary Format '''for the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is to make sure if the correct version of the JDK has been chosen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, if you choose the latest version of JDK, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
then the applet might not run on machines &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
that have an older version of the Java browser plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Right-Click the SampleApplet project node in the Projects window,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and select '''New&amp;gt;Other'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Under '''Categories''', select '''Java'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Under '''File Types''', select '''Applet'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Under '''Class Name''', type '''Sample'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Under '''Package''', type '''org.me.hello'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The IDE creates the applet source file in the specified package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can expand the '''Source Package''' node in the '''Projects''' window to see this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The applet source file opens in the source editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let us now define our applet class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I have the code for a simple applet,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
that sets the background color to cyan,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the foreground color to red,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and displays a message that illustrates the order &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
in which the methods in the applet, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
i.e. the '''init()''',''' start()''', and '''paint()''' methods are called,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when the applet starts up.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I will copy this code and paste it over the existing default code in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Running an Applet Source File''&lt;br /&gt;
&lt;br /&gt;
Right-Click the Sample.java file node in the '''Projects '''window,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and choose '''Run File '''from the contextual menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Sample.html launcher file, with the applet embedded, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
is created in the ''build ''folder,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
which you can see if you switch to the '''Files '''window.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| ''Show Applet Window''&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:0.035cm solid #000000;padding:0.097cm;&amp;quot;| The Applet is now launched in the Applet viewer.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| Switch to Netbeans Window&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:0.035cm solid #000000;padding:0.097cm;&amp;quot;| ''Embedding an Applet in a Web Application''&lt;br /&gt;
&lt;br /&gt;
Your applet is now complete.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we need to make it available to the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To do so, we create a web application,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
put the applet JAR on its class-path, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and then add an applet tag to the web application's HTML file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Creating the Web Project''&lt;br /&gt;
&lt;br /&gt;
Choose '''File&amp;gt;New Project'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Under '''Categories''', select '''Java Web'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Under '''Projects''', select '''Web Application'''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Under '''Project Name''', type '''HelloSampleApplet'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Set the project location to any location on your system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click Next, select your server and click Finish.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Adding the Applet JAR file to the web project''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When you want to include an applet JAR file in a web project,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
you can do so by adding the Java Project that contains the JAR file,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
or by adding the JAR file itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also note that, when you add the Java project to the web project,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
you enable to IDE to build the applet whenever you build the web application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Therefore, when you modify the applet in the Java project,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the IDE builds a new version of the applet whenever the web project is built.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the '''Projects '''window, right-click the HelloSampleApplet project node,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and select '''Properties '''from the contextual menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Our applet is in a Java project, so we select '''Packaging''',&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and click '''Add Project'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Browse to, and select the folder that contains the Java project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The JAR file containing the applet source file is listed in the table &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
at the bottom of the Project Properties dialog box.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click Add File.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When you build the HelloSampleApplet project,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the applet's JAR file is generated in the original SampleApplet project&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and is packaged in the HelloSampleApplet project's WAR file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is also added to the ''build/web ''folder, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
which you can see in the '''Files '''window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Create and Run the HTML file''&lt;br /&gt;
&lt;br /&gt;
Let us embed the applet in an HTML file,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
right-click the HelloSampleApplet project node,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and choose New&amp;gt;Other from the contextual menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Under Categories, select Web.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Under File Types, select HTML.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click Next.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let us name our HTML file as MyApplet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click Finish.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let us enter the applet tag between the body tags now.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Right click the HTML node in the Projects window, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and choose Run File from the contextual menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Server deploys the HTML file in the IDE's default browser.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| ''Switch to Slide 5, Slide 6''&lt;br /&gt;
&lt;br /&gt;
''Assignment''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:0.035cm solid #000000;padding:0.097cm;&amp;quot;| '''''Assignment'''''&lt;br /&gt;
&lt;br /&gt;
As your assignment,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create another simple banner applet in the IDE,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
where the applet scrolls a message,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
from left to right,across the applet's window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Embed your applet in a web application,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
add JAR files to the web project and,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create and run the HTML file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I have created my moving banner applet which looks like this.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| Slide 7, Slide 8 , Slide 9&lt;br /&gt;
&lt;br /&gt;
About the Spoken Tutorial Project&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:0.035cm solid #000000;padding:0.097cm;&amp;quot;| The video available at [http://spoken-tutorial.org/What_is_a_Spoken_Tutorial http://spoken-tutorial.org/What_is_a_Spoken_Tutorial] summarizes the spoken tutorial project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you do not have a good bandwidth, you can download and watch it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We conduct workshops using spoken tutorials.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We also give certificates to those who pass an online test.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please contact us for more details.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| Slide 10, Slide 11&lt;br /&gt;
&lt;br /&gt;
Acknowledgement&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Spoken Tutorial project is a part of the Talk to a Teacher Project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Supported by the National Mission on Education through ICT, MHRD, Govt of India.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This project is co-ordinated by [http://spoken-tutorial.org/ http://spoken-tutorial.org].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More information on the same is available at gttp://spoken-tutorial.org/NMEICT-Intro&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| Slide 12&lt;br /&gt;
&lt;br /&gt;
Thank You&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.035cm solid #000000;border-left:0.035cm solid #000000;border-right:0.035cm solid #000000;padding:0.097cm;&amp;quot;| This is Sindhu Ghanti from IT for Change signing off.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thank you&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Chandrika</name></author>	</entry>

	</feed>