Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can I load an applet dynamically into a Java application, and if so, how does the applet get the parameter information it would normally get from the APPLET tag?

0
Posted

Can I load an applet dynamically into a Java application, and if so, how does the applet get the parameter information it would normally get from the APPLET tag?

0

Ans : Applets can be loaded into Java applications like other user-interface elements, but you must use care to provide them with the connections and support they normally expect to receive from a web browser. Applets are a subclass of Panel, which in turn is a subclass of Component – the base class for all Abstract Window Toolkit (AWT) user-interface elements. In terms of building an interface, you can add an applet to a panel or window/frame just the same as you would a button: Applet myApplet = … Panel p = new Panel(); p.add(myApplet); p.add(new Button(“Press me.”)); Applets generally require much more care, though, in how they are hooked up to the rest of the application. For an application to provide a general framework for linking in applets, it must provide objects that implement the AppletContext and AppletStub interfaces. (Note that one class can implement both interfaces.) For example, in the JDK (1.0.2 and 1.1), an applet call to getParameter gets relayed to an AppletStub

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.