import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.io.*; import java.net.*; public class Jutuklient1 extends Applet implements ActionListener{ int nr=100; TextField tf=new TextField("100"); public Jutuklient1(){ add(tf); tf.addActionListener(this); } public void actionPerformed(ActionEvent e){ try{ Socket sc=new Socket("ws0.cs1.tpu.ee", 3001); PrintWriter valja=new PrintWriter(sc.getOutputStream(), true); valja.println(tf.getText()); }catch(Exception viga){ System.out.println(viga); } } public static void main(String argumendid[]){ Frame f=new Frame("Ruudu joonistamine"); f.setSize(300, 300); f.add(new Jutuklient1()); f.setVisible(true); } }