import java.applet.Applet; import java.awt.*; import java.awt.event.*; public class Roomanr extends Applet implements ActionListener{ TextField tf1=new TextField(20); TextField tf2=new TextField(20); TextField tf3=new TextField(20); public Roomanr(){ add(tf1); add(tf2); add(tf3); tf1.addActionListener(this); } public void actionPerformed(ActionEvent e){ tf2.setText("sisestatud nr: "+tf1.getText()); //sama number tekstivälja String nr=tf1.getText(); //jõumeetodiga numbrid 1-10 if(nr.equals("1")){ tf3.setText("I"); } if(nr.equals("2")){ tf3.setText("II"); } if(nr.equals("3")){ tf3.setText("III"); } if(nr.equals("4")){ tf3.setText("IV"); } if(nr.equals("5")){ tf3.setText("V"); } if(nr.equals("6")){ tf3.setText("VI"); } if(nr.equals("7")){ tf3.setText("VII"); } if(nr.equals("8")){ tf3.setText("VIII"); } if(nr.equals("9")){ tf3.setText("IX"); } if(nr.equals("10")){ tf3.setText("X"); } } public static void main(String argumendid[]){ Frame f=new Frame(); f.setSize(300, 300); f.add(new Roomanr()); f.setVisible(true); } }