Explain the applet in java, JAVA Programming

Assignment Help:

Explain The Applet in java?

The reason people are excited about Java as more than just another OOP language is because it allows them to write interactive applets on the web. Hello World isn't an extremely interactive program, other than let's look at a webbed version.
import java.applet.Applet;
import java.awt.Graphics;

public class HelloWorldApplet extends Applet {

public void paint(Graphics g) {
g.drawString("Hello world!", 50, 25);
}
}
The applet version of HelloWorld is a little more complicated than the HelloWorld application, and it will take a little more effort to run it as well.
First kind in the source code and save it into file known as HelloWorldApplet.java. Compile this file in the usual way. If all is well a file known as HelloWorldApplet.class will be formed. Now you required to create an HTML file that will involved your applet. The following easy HTML file will do.
< html>
< head>
< title> hello world
< /head>

< body>
This is the applet:< P>
< applet code="HelloWorldApplet" width="150" height="50">
< /applet>
< /body>
< /html>

Save this file as HelloWorldApplet.html in the similar directory as the HelloWorldApplet.class file. While you've done that, load the HTML file into a Java enabled browser. You should see something like below, by of course the exact details depend on that browser you use.

If the applet compiled without error and produced a HelloWorldApplet.class file, and yet you don't see the string "Hello World" in your browser chances are that the .class file is in the wrong place. Make sure HelloWorldApplet.class is in the similar directory as HelloWorld.html. Also make sure in which your browsers supports Java or that the Java plugin has been installed. Not all browsers support Java out of the box.

Several browsers have less than perfect support for Java so if you have trouble along with an applet, the first thing to try is loading it within Sun's Applet Viewer instead. If the Applet Viewer has a problem, then chances are pretty good the problem is with the applet and not with the browser.


Related Discussions:- Explain the applet in java

Describing service oriented architecture (soa)? , Service Oriented Architec...

Service Oriented Architecture Service Oriented Architecture (SOA) is an evolution of the fundamentals governing a component based development. Component based development gives

Api consumer, API consumer -This application should consume a third pa...

API consumer -This application should consume a third party API -You should use more than just one method of the API, I'd like to see at least 3 or 4 -Have some concept

What is dynaactionform, A specialized subclass of ActionForm that permits t...

A specialized subclass of ActionForm that permits the creation of form beans with dynamic sets of properties (configured in configuration file), without requiring the developer to

Equation tool, i need help i hav done the gui part of my project and some s...

i need help i hav done the gui part of my project and some simple symbols but to display some complex symbols like integration and all but it shud be clear with lower and upper lim

Project, Prog. Concepts - Project The objective is to implement a menu - ba...

Prog. Concepts - Project The objective is to implement a menu - based system for Bank Accounts in order to simulate a very simple banking system. Many structures have to be declare

What is preferred organizational structure for organization, What is the pr...

What is the preferred organizational structure for the organization? The Network Organization is becoming the preferred organizational structure.

How are this () and super() used with constructors, How are this () and sup...

How are this () and super() used with constructors? this() Constructors: is used to pointing current class instance. Can be used with methods or variables. Used to call

Program to develop a multimedia simulation , Normal 0 false f...

Normal 0 false false false EN-IN X-NONE X-NONE

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd