• Post Reply Bookmark Topic Watch Topic
  • New Topic

Applets init()  RSS feed

 
ml behra
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody!!!
In a applet we have init() method and it is invoked when the applet is first loaded.Can we invoke the constructor of the class before init().if so how?
thanks in advance.
 
Grant Crofton
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think applet's use constructors io the same way as normal - init() IS the applet's constructor.
 
Stephanie Grasson
Ranch Hand
Posts: 347
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe you need to make the constuctor for your applet public.
A little example is included below:

Hope this helps.
Stephanie
 
ml behra
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks stephanie for ur reply.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!