how to call an applet from another applet
hi
i have 2 applets each has separately its own init(),paint() methods.they basically read the data from 2 data files and draw the figures.
What i want to do is since the 2 applets use the same data files i want to run any one applet depending upon the data in the data files.how to combine them.
this is the html file
<html>
<head><title>IFM</title>
</head>
<body>
<applet code=IfmComp.class width=1500 height=2500>
<param name=IDataFileName value="ProppedBeam.dat">
<param name=ODataFileName value="ProppedBeam.out">
<param name=Title value="Three Bar Truss">
</applet>
<applet code=Beam.class width=1500 height=2500>
<param name=IDataFileName value="ProppedBeam.dat">
<param name=ODataFileName value="ProppedBeam.out">
<param name=Title value="Three Bar Truss">
</applet>
</body>
</html>
The IfmComp.java is
public class IfmComp {
public void init() {
input = getParameter("IDataFileName");
is = new URL(getDocumentBase(),input);
InputStream fileIn = is.openStream();
int bytes = fileIn.read(buffer,0,100000);
str = new String(buffer,0,bytes);
String str2;
if( str2.equals("IFMBM") {
Beam b =new Beam(); } // if i do in this way both the appets r displayed but i want to display only the beam applet when the string is equal to IFMBM.
}
public void paint() {
g.drawLine(x1,y1,x2,y2);
}
}
// simllary Beam.java has the same methods and reading data.
so how to
pls help me i need to do this project as soon as possible.

