import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.lang.*; public class Tahed1 extends Applet implements ActionListener { TextField tf1=new TextField(20); TextField tf2=new TextField(20); Button vajuta=new Button("Vajuta"); public Tahed1(){ add(tf1); add(tf2); add(vajuta); tf1.addActionListener(this); vajuta.addActionListener(this); } int i=0; int nr; int koht=0; public void actionPerformed(ActionEvent e){ String s = tf1.getText(); int pikkus=s.length(); char[] tahed = new char[pikkus]; for(int nr=tahed.length; nr>=0; nr--){ try{ char taht=s.charAt(nr); tahed[nr]=taht; Thread.sleep(1000); tf2.setText(s.substring(nr)); }catch(Exception viga){} } } public static void main(String argumendid[]){ Frame f=new Frame(); f.add(new Tahed1()); f.setSize(200,200); f.setVisible(true); } }