What happens when an Applet is loaded?
What happens when an Applet is loaded?
When an applet is loaded, a sequence of actions, defined by the applet lifecycle, is initiated by the Java runtime environment. Here's a step-by-step description of what happens:
Applet Class Loading: The class files of the applet are loaded by the Java runtime environment. This includes the main applet class that extends java.applet.Applet or javax.swing.JApplet if Swing components are used.
Applet Instance Creation: An instance of the applet's class is created. This is the point where the applet's constructor is called if it has one.
Initialization with init() Method: The init() method of the applet is called next. This method is designed for one-time initialization tasks that do not require the applet to be active or interactive. It is typically used to set up the user interface components and load resources like images or fonts.
Đăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.