aspose file tools*
The moose likes Applets and the fly likes Java Applets,Threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Java Applets,Threads" Watch "Java Applets,Threads" New topic
Author

Java Applets,Threads

Prathiba krishnamurthy
Greenhorn

Joined: Feb 18, 2003
Posts: 4
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

Joined: Sep 02, 2003
Posts: 135

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

Joined: Nov 22, 2008
Posts: 18944
by default an applet extends Applet class. so anyway MUST use Implements...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Applets,Threads