import java.awt .* ; import java .awt .event .*; public class Sum implements ActionListener { Frame f; TextArea ta; TextField tf1,tf2; Image icon ; int arv1,arv2; Sum(){ f=new Frame ("Korrutamine"); ta=new TextArea (); tf1=new TextField (); tf2=new TextField (); tf1.addFocusListener (new Voku(tf1,tf2,ta)); icon=Toolkit.getDefaultToolkit ().getImage ("c:/mir/icon.gif"); f.setIconImage (icon); f.setLocation (100,100); f.setSize (400,300) ; f.setLayout(new BorderLayout ()); Container c; f.add (c=new Container (),BorderLayout.NORTH ); c.setLayout (new GridLayout (1,2)); c.add (tf1); c.add (tf2); f.add (ta,BorderLayout.CENTER ); f.addWindowListener (new WindowAdapter(){ public void windowClosing(WindowEvent we){System.exit (0) ;} }); this.menyy(); f.setVisible (true); } class Voku extends FocusAdapter { TextField tf1 ,tf2; TextArea ta; Voku(TextField tf1 , TextField tf2 ,TextArea ta){ this.tf1 =tf1 ; this.tf2 =tf2 ; this.ta =ta ; } public void focusGained(FocusEvent fe){ tf1.setText (""); tf2.setText (""); ta.setText(""); } } void menyy(){ MenuBar mb=new MenuBar (); Menu menu=new Menu ("Menyy"); MenuItem [] Menyy={new MenuItem ("Uus"),new MenuItem ("Arvuta"),new MenuItem ("-"),new MenuItem ("Välja") }; int i=0; for( ;i0 ;i--){ try{ Integer arv=new Integer (a1.substring (i-1,i)) ; Long korrutis=new Long ((long)(arv.intValue ())*Math.abs (b.intValue ())); if(i>1 & i