• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

how do i call an applet from an applet

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,
i am trying to write an application which requires me to call an applet from another applet. the calling applet has a button, pressing which calls the called applet . the "actionPerformed(ActionEvent e)" method of the calling applet has the following code:

public void actionPerformed(ActionEvent e)
String buttonpressed = e.getActionCommand();
if(buttonpressed == "Statistics")
mystat is the instance of the called applet class.
Essentially I want a new window to appear, which starts the calling applet, when I press the button on the calling applet.
any help is greatly appreciated.
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try Using AppletContext to get an instance of the other applet
[This message has been edited by Pradeepta Bhattacharya (edited September 09, 2001).]
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just posted a similar reply in the general Beginner area.
Basically, you should create a new class which extends Frame and then adds an instance of the applet (which is easy because Applet extends Panel).
Geoffrey, Canada
Sun Certified Programmer for the Java 2 Platform
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic