import java.awt.*; import java.awt.event.*; import java.applet.*; //import javax.swing.*; /** *

* Pisike programm, mis töötab appletina ja püüab leida * sisestatud arvu ristsumma */ public class rsumma extends Applet implements ActionListener{ TextField tf; TextField rsumma; public void init(){ //getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS)); tf = new TextField(6); Button b = new Button("Ristsumma"); b.addActionListener(this); rsumma = new TextField(6); rsumma.setEditable(false); add(tf); add(b); add(rsumma); } public void actionPerformed(ActionEvent e){ int nr=0, rsum=0; StringBuffer s = new StringBuffer(tf.getText()); for(int n=0; n