import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.io.*; public class Pakib1 extends Applet implements ActionListener { int vanaarv=0; Label silt1=new Label("Sinu sõna: "); Label silt2=new Label("Tulemus: "); Label silt3=new Label("Faili nimi: "); TextField tf1=new TextField(20); Button kirjutaf=new Button("Kirjuta faili"); Button loef=new Button("Loe failist"); TextField tf2=new TextField(30); TextField tf3=new TextField(10); public Pakib1(){ add(silt1); add(tf1); add(silt2); add(tf2); add(silt3); add(tf3); add(kirjutaf); add(loef); kirjutaf.addActionListener(this); loef.addActionListener(this); tf1.addActionListener(this); } public void actionPerformed(ActionEvent e){ if(e.getSource()==kirjutaf){ Kirjuta_faili(); repaint(); }else if(e.getSource()==loef){ Loe_failist(); repaint(); }else if(e.getSource()==tf1){ Teisenda(); repaint(); } } public void Teisenda(){ try{ String s = tf1.getText(); int loe=1; for(int i=0;i