Explain the procedure for converting an applet to an application.

      

Explain the procedure for converting an applet to an application.

  

Answers


gregory
? Build a Java JApplet (or Applet). (Let’s assume you name the class AppletToApplication).
? Change the name of your applet’s init() method to be the same as the name of your class (in this
case: AppletToApplication). This is now the constructor method for the class.
? Delete the word void in the header of your new AppletToApplication constructor, since a
constructor has no return type.
? Alter the class header so that it extends Frame rather than Applet (or JApplet) .
? Create a new method called main.
? Delete the import for the class Applet, since it is now redundant.
? Add window methods (e.g., windowClosing to handle the event which is the user clicking on the
close window button, and others).
? Make sure that the program does not use any of the methods that are special to the Applet class –
methods including getAudioClip , getCodeBase , getDocumentBase , and getImage
gregorymasila answered the question on January 24, 2018 at 17:43


Next: Using a code snippet show how to set the layout of a user interface.
Previous: State and briefly describe the four methods that define the structure of an Applet.

View More Computer Science Questions and Answers | Return to Questions Index


Exams With Marking Schemes

Related Questions