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

what is meant by binding in rmi, Binding is a method of associating or re...

Binding is a method of associating or registering a name for a remote object that can be used at a later time to look up that remote object. A remote object can be linked with a na

What are the components of struts, Struts components can be classify into M...

Struts components can be classify into Model, View and Controller: ? Model: Components like business logic /business processes and data are the type of model. ? View: HTML, J

Servlet, how to request one servlet to another by passing value

how to request one servlet to another by passing value

Create a usercontrol called loginpasswordusercontrol, (Login User Control) ...

(Login User Control) Create a UserControl called LoginPasswordUserControl that contains a Label (loginLabel) that displays string "Login:", a TextBox (loginTextBox), where the user

What is pop, The Post Office Protocol is an application-level protocol with...

The Post Office Protocol is an application-level protocol within an intranet which is used by the local e-mail clients to send and retrieve e-mails from a remote server those are l

What is alternate text, What is Alternate Text ? The APPLET element ca...

What is Alternate Text ? The APPLET element can have an ALT attribute. An ALT attribute is used through a browser which understands the APPLET tag but for some purpose cannot

Oop, creating a point of sale

creating a point of sale

Debugging, Debugging mode can be enabled by adding the following line of co...

Debugging mode can be enabled by adding the following line of code before creating new connections: XMPPConnection.DEBUG_ENABLED = true; When debugging mode is enabled, a

What is jar archives, What is JAR archives? JAR archives are ZIP archiv...

What is JAR archives? JAR archives are ZIP archives along with a different extension. They contain a hierarchy of files and directories. In spirit a JAR file can take the place

String, in java string is a

in java string is a

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