202k views
2 votes

\underline{ \large{ \sf{ \purple{Question:-}}}}

Differentiate between executing the applet with appletviewer and HTML file.

\\ \\ \\
Thank You ! ​

User Loentar
by
7.3k points

2 Answers

0 votes

Answer:

When you run an applet using the appletviewer tool, it does not need to be embedded within an HTML file; instead, it can be launched directly. HTML file: On the other hand, applets can also be embedded within HTML files. To run the applet, you would open the HTML file in a web browser that has a JVM.

Step-by-step explanation:

THIS ANS WILL HELP U :D

User Vincent Panugaling
by
8.4k points
6 votes

When it comes to executing an applet, there are two common approaches: using the appletviewer command and embedding the applet in an HTML file. Let's differentiate between these two methods:

1. Appletviewer:

  • - The appletviewer is a tool provided by Java Development Kit (JDK) specifically designed for running Java applets.
  • - It is a standalone application that allows you to view and test your applets without the need for a web browser.
  • - You execute the appletviewer from the command line by specifying the HTML file that references the applet.
  • - The appletviewer creates a window to display the applet and provides a separate environment for running the applet.
  • - It provides a more isolated and controlled environment for applet execution, making it easier to debug and test applets.

2. HTML File:

  • - Applets can also be embedded in HTML files and run through web browsers that support Java applets.
  • - In this approach, you write an HTML file that includes the necessary applet tags to specify the applet class and any required parameters.
  • - When the HTML file is loaded in a Java-enabled web browser, it interprets the applet tags and invokes the Java Virtual Machine (JVM) to execute the applet.
  • - The applet runs within the web browser's context and shares resources and functionalities with other web page elements.
  • - The HTML file approach allows you to integrate applets seamlessly into web pages and leverage the full capabilities of HTML and JavaScript along with the applet.

In summary, the key differences between executing an applet with appletviewer and HTML file are:

  • - The appletviewer is a standalone application for running applets, while the HTML file approach relies on a web browser with Java support.
  • - Appletviewer provides a controlled environment for applet execution, separate from the web browser, facilitating debugging and testing.
  • - The HTML file approach allows applets to be seamlessly integrated into web pages, taking advantage of HTML and JavaScript features.
  • - Appletviewer requires running a command from the command line and specifying the HTML file, whereas HTML files can be loaded directly in a web browser.


\huge{\mathfrak{\colorbox{black}{\textcolor{lime}{I\:hope\:this\:helps\:!\:\:}}}}

♥️
\large{\textcolor{red}{\underline{\mathcal{SUMIT\:\:ROY\:\:(:\:\:}}}}

User Kiran Biradar
by
7.6k points