Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In java OOP (Applet) Answer the following questions: What is an applet? How does

ID: 3818635 • Letter: I

Question

In java OOP (Applet) Answer the following questions: What is an applet? How does applet differ from applications? What are the attributes of Applet tags? Find the errors in the given applet a.//Using the Status Window. import java.awt.*; import jaya.applet.*;/* */public class StatusWindow extends Swing {public void init() {setBackground(Color cyan);}//Display msg in applet window. public void paint(Graphics g) {b. drawstring("This is in the applet window.", 10, 20); showStatus("This is shown in the status window.");}} How can we determine the width and height of my apple? What are methods that controls an applet's life cycle? How to read information from the applet parameters? Difference between an Applet and an Application?

Explanation / Answer

1 Difference between Applet and Application
An applet is a program written in the Java programming language that can be included in an HTML page, much in the same way an image is included. An application is a standalone Java program that runs as a true application, outside of a browser.

2. attribute of applet tags
- height : Defines height of applet
- width: Defines width of applet
- align: Defines the text alignment around the applet
- alt: An alternate text to be displayed if the browser support applets but cannot run this applet
- archive: A URL to the applet when it is stored in a Java Archive or ZIP file
- code: A URL that points to the class of the applet
- codebase: Indicates the base URL of the applet if the code attribute is relative
- hspace: Defines the horizontal spacing around the applet
- vspace: Defines the vertical spacing around the applet
- name: Defines a name for an applet
- object: Defines the resource name that contains a serialized representation of the applet
- title: Display information in tool tip

3.errors in the given code.
there is no class like Swing in java
instead use JFrame
use g.drawString();
and instead of drawStatus use setStatus();

4 Determine height and width of the applet

5.Methods of applet Lifecycle
init()
start()
paint()
stop()
destroy()

6.Read information from the applet parameters
The getParameter() method can be used within the init() method to access the parameter data.

- It takes the parameter name as an argument.

Example:

public void init()
{
   String val = getParameter("foreground-color");
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote