What are the advantages of the model over the event-inheritance model

The event-delegation model has two advantages over the event-inheritance model. They are: a)It enables event handling by objects other than the ones that generate the events. This allows a clean separation between a component’s design and its use. b)It performs much better in applications where many events are generated. This performance improvement is due to … Read more

What is an event and what are the models available for event handling

?– An event is an event object that describes a state of change in a source. In other words, event occurs when an action is generated, like pressing button, clicking mouse, selecting a list, etc. There are two types of models for handling events and they are: a) event-inheritance model and b) event-delegation model. In … Read more

How do you set security in applets

using setSecurityManager() method. In Java, applets are small Java programs that are typically embedded in web pages and run in a web browser. Security in Java applets is a crucial aspect to prevent potentially harmful actions and protect the user’s system. Here are the key aspects of setting security in Java applets: Security Managers: Java … Read more

What is the lifecycle of an applet

?– init() method – Can be called when an applet is first loaded start() method – Can be called each time an applet is started. paint() method – Can be called when the applet is minimized or maximized. stop() method – Can be used when the browser moves off the applet’s page. destroy() method – … Read more

When do you use codebase in applet

When the applet class file is not in the same directory, codebase is used. In Java applets, the codebase attribute is used to specify the base URL for applet class files. The codebase attribute allows you to specify the location from which the browser should load the applet’s class files. This attribute is particularly useful … Read more