Explain Applet.

  • Applets are small programs that are designed to execute in web browsers to generate dynamic content. They require a Java plugin to run on the client browser. Applets work at the client-side with minimum response time. They can be executed by browsers on multiple platforms such as Windows, Linux, and Mac. In an applet, the code is embedded in an HTML page. When there is a java-enabled web browser, the applet code transfers to the system, and code is executed on the browser.
  • Applets can be used to perform various tasks. They can be used to display graphics, create animations, play sound, etc. It is possible to add an applet to a web page locally or remotely. A local applet is developed and stored in the local system. A remote applet is developed and stored externally.


  • An applet is a Java program that can be embedded into a web page. It runs inside the web browser and works on the client-side. An applet is embedded in an HTML page using the APPLET or OBJECT tag and hosted on a web server.
  • Applets are used to make the website more dynamic and entertaining.
  • Applets are small programs that utilize an external API for its execution and are primarily used in internet computing. They can be transferred over the Internet from one computer to another and run using the Applet Viewer or any web browser that supports Java. An applet can support several applications such as executing arithmetic operations, the creation of animation, graphics displaying, playing interactive games.

  • Java has transformed the manner in the Internet users retrieve and use documents on the world wide network. Applets have enabled to construction and use of completely interactive multimedia Web documents. A web page can include a java applet which, when executed, can generate graphics, sounds, and moving images rather than just containing plain text or a static image.


Important points : 

1. All applets are sub-classes (either directly or indirectly) of java.applet.Applet class.

2. Applets are not stand-alone programs. Instead, they run within either a web browser or an applet viewer. JDK provides a standard applet viewer tool called applet viewer.

3. In general, execution of an applet does not begin at main() method.

4. Output of an applet window is not performed by System.out.println(). Rather it is handled with various AWT methods, such as drawString().


There are two ways an applet can integrate into web pages.

  • First in which we can write our own applets and integrate them into web pages. These types of applets evolved locally and kept in a local system is known as a local applet.
  • Second, we can download an applet from a remote computer system and then embed it into a web page.

These types of applets which are developed externally and stored on a remote computer to the Internet are known as a remote applet.


 OR,

Unlike a Java application program, an applet is specifically designed to be executed within an HTML web document using an external API. They are basically small programs – more like the web version of an application – that require a Java plugin to run on client browser. They run on the client side and are generally used for internet computing. You can execute a Java applet in a HTML page exactly as you would include an image in a web page. When you see a HTML page with an applet in a Java-enabled web browser, the applet code gets transferred to the system and is finally run by the Java-enabled virtual machine on the browser.

Applets are also compiled using the javac command but can only run using the appletviewer command or with a browser. A Java applet is capable of performing all kinds of operations such as play sounds, display graphics, perform arithmetic operations, create animated graphics, etc. You can integrate an applet into a web page either locally or remotely. You can either create your own applets locally or develop them externally. When stored on a local system, it’s called a local applet. The ones which are stored on a remote location and are developed externally are called remote applets.

Browsers come with Java Runtime environment (JRE) to execute applets and these browsers are called Java-enabled browsers. The web page contains tags which specify the name of the applet and its URL (Uniform Resource Locator) – the unique location where the applet bytecodes reside on the World Wide Web. In simple terms, URLs refer to the files on some machine or network. Unlike applications, Java applets are executed in a more restricted environment with harsh security restrictions. They cannot access the resources on the system except the browser-specific services.


Comments

Popular posts from this blog

Suppose that a data warehouse for Big-University consists of the following four dimensions: student, course, semester, and instructor, and two measures count and avg_grade. When at the lowest conceptual level (e.g., for a given student, course, semester, and instructor combination), the avg_grade measure stores the actual course grade of the student. At higher conceptual levels, avg_grade stores the average grade for the given combination. a) Draw a snowflake schema diagram for the data warehouse. b) Starting with the base cuboid [student, course, semester, instructor], what specific OLAP operations (e.g., roll-up from semester to year) should one perform in order to list the average grade of CS courses for each BigUniversity student. c) If each dimension has five levels (including all), such as “student < major < status < university < all”, how many cuboids will this cube contain (including the base and apex cuboids)?

Discuss classification or taxonomy of virtualization at different levels.

Suppose that a data warehouse consists of the three dimensions time, doctor, and patient, and the two measures count and charge, where a charge is the fee that a doctor charges a patient for a visit. a) Draw a schema diagram for the above data warehouse using one of the schemas. [star, snowflake, fact constellation] b) Starting with the base cuboid [day, doctor, patient], what specific OLAP operations should be performed in order to list the total fee collected by each doctor in 2004? c) To obtain the same list, write an SQL query assuming the data are stored in a relational database with the schema fee (day, month, year, doctor, hospital, patient, count, charge)