import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class AREADETEXTO2 extends Applet implements ActionListener {
TextArea areaTexto;
Button boton;
public void init() {
areaTexto = new TextArea("Ya es la hora.",5,20,TextArea.SCROLLBARS_BOTH);
add(areaTexto);
boton = new Button("Haga clic aquí");
add(boton);
boton.addActionListener(this);
}
public void actionPerformed(ActionEvent e) {
if (e.getSource() == boton) {
String texto = areaTexto.getText();
String cadena = new String("hora");
int posicion = texto.indexOf(cadena);
areaTexto.select(posicion,posicion+cadena.length() );
}
}
}





Mode Lineal
