Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting a Java application to an applet

Status
Not open for further replies.

humbug

Technical User
Sep 11, 2000
3
GB
I'm trying to convert a Java application to an applet. I've spent some days scouring the Web for an answer, and I think I'm doing what everyone recommends.

The existing Application is a subclass of a Runnable subclass of a Panel, with a main() function which simply declares an instance of itself, then calls its own init() function. The Application init() creates a frame, and all the subsequent action takes place in the frame. It works fine as an application.

In trying to convert it, I just wrote an applet:

import java.applet.Applet;
public class Bapplet extends Applet
{
public Application application;
public void init()
{
application = new Application();
this.add(application);
application.init();
}
}

It then goes through the motions of starting the Application, including creating the frame and putting some of the furniture in it, but hangs before init() is complete.

I later added start() and stop() overrides to the applet which call the (Runnable, remember) application.start() / .stop(), but that didn't seem to help.

Any idea what am I likely to have missed / done wrong?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top