why we have to extends applet class in applet program

Discussion in 'Java' started by mahesh@maahi, Mar 29, 2012.

  1. mahesh@maahi

    mahesh@maahi New Member

    Joined:
    Mar 29, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    plz ans me some one
     
  2. state

    state New Member

    Joined:
    Sep 14, 2011
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    0
    import java.applet.*;

    public class GuiExample extends Applet


    Consider the above example.What we are doing here is
    1)importing the applet package which contains not the Applet class.
    2)In the next line the Applet class is inherited so that its methods init,start,stop,destroy,paint can be overridden to perform the desired task.
    Hope this helps.Good Luck
     
  3. state

    state New Member

    Joined:
    Sep 14, 2011
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    0
    I am sorry I meant "which contains the Applet class"
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice