calling applet from applet

Hi,

I am developing a chat application. In which I used socket connection. Now everything is ok but I have one requirement When user log in he or she must be asked for selecting room name. These rooms must be got from server. So room selection dialog must be applet and must astablish connection to server and get the room list and then allow user to select room and after selecting the room chat applet must be called.

So my question is how to call applet from applet.

Please give me answer.

[517 byte] By [imran_mansuria] at [2007-9-29 16:08:36]
# 1

from what i understood by what u said.. you r trying to call an applet on one html file to another applet!!! so i suggest that u put the second applet into a separate html file and then try to call that html file from your first html using this code

try { // create a new java.net.URL

URL urlToJumpToo = new URL("http://someUrl.tld"); // get the applet context and call the showDocument(URL) method on it this.getAppletContext.showDocument(urlToJumpToo);}

catch (MalformedURLException me) { // not a valid URL System.out.println("http://some.Url.tld is not a valid URL: " + me.getMessage());}

khalidmmma at 2007-7-15 14:19:51 > top of Java-index,Archived Forums,Java Programming...
# 2
I see you need to fetch the room list from the server, but I don't see why you would need two seperate applets for your problem. Can't you just use one single applet to fetch the room list from the server and then fullfill the chat functionality.
beyond_repaira at 2007-7-15 14:19:51 > top of Java-index,Archived Forums,Java Programming...
# 3
i agree with u beyound!!!
khalidmmma at 2007-7-15 14:19:51 > top of Java-index,Archived Forums,Java Programming...