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

Image caching with html, In the airplane program, you may have noticed that...

In the airplane program, you may have noticed that the loading of each image appears to be jerky, erratic, or slow, and that the URL for each image flickers in the status bar each

What is white space explain proper use of white space java, What is White S...

What is White Space? explain proper use of white space in java? White space consists mainly of the space character in which you generates through hitting the space bar on your

Board Coloring, BoardColoring.java program for 2D MXM matrix

BoardColoring.java program for 2D MXM matrix

Explain the rules for tostring() methods, Explain the Rules for toString() ...

Explain the Rules for toString() Methods ? toString() methods should return a single line of text that does not contain any carriage returns or linefeeds. toString() methods

PROBLEM 2, #The objective is to implement a menu-based system for Bank Acco...

#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 declared to manage bank accounts.

A java gui application, Design A Word document/ report containing pro...

Design A Word document/ report containing program design documentation, including UML diagrams (Use case, class and sequence) and written descriptions of each class or module

Luminous Jewels, Byteland county is very famous for luminous jewels. Lumino...

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Cyclos ussd and mobile banking ivr module, Cyclos USSD and mobile banking I...

Cyclos USSD and mobile banking IVR module Project Description: We previously have a Cyclos mobile banking solution deployed on our server with SMS banking module. The solu

Application of server clustering? , An application server cluster has of a ...

An application server cluster has of a number of application servers loosely coupled on a network. The server group or server cluster is usually distributed over a number of nodes

Constractar, Create a class HourlyWorker mind: particularHourlyWorker emplo...

Create a class HourlyWorker mind: particularHourlyWorker employee. • Declare two data members named wage and hours of double type with private access. • Implement a parameterized c

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