File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Applets,Threads

 
Prathiba krishnamurthy
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. How do you communicate between 2 applets?
2. Implementing a runnable interface/extending a thread class. which is better?
Thanks in advance
Regards
Prathiba
 
Idly Vada
Ranch Hand
Posts: 135
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

1. How do you communicate between 2 applets?

The AppletContext class in the java.applet package contains the two member functions getApplet and getApplets. By using those functions, an applet can find other applets and invoke methods on them. That can only be done if the following security requirements are met:
i)The applets originate from the same server and from the same directory on the server.
ii)The applets are running on the same page and in the same browser window.
Originally posted by Prathiba krishnamurthy:

2. Implementing a runnable interface/extending a thread class. which is better?

When your class which should run in seperate thread needs to extend another class, go for runnable.Otherwise any approach is fine.
Before going for extending Thread, make sure that the class need not extend any class in future.
[ September 17, 2003: Message edited by: Murthy Narasimha ]
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
by default an applet extends Applet class. so anyway MUST use Implements...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic