import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
/*<APPLET CODE=JavaExampleFindObjInApplet.class WIDTH=210 HEIGHT=210 ></APPLET>*/
public class JavaExampleFindObjInApplet extends Applet implements ActionListener
{
TextArea TxtArea;
Button BtnFnd;
public void init()
{
TxtArea = new TextArea("Now The Time is.",10,25,TextArea.SCROLLBARS_BOTH);
add(TxtArea);
BtnFnd = new Button("Find\"Time\"");
add(BtnFnd);
BtnFnd.addActionListener(this);
}
public void actionPerformed(ActionEvent e1)
{
if(e1.getSource() == BtnFnd)
{
String S1 = TxtArea.getText();
String S2 = new String("Time");
int Lct = S1.indexOf(S2);
TxtArea.select(Lct,Lct+S2.length()) ;
}
}
}