import java.awt.*; import java.awt.event.*; import java.awt.Label; //public class word extends Frame { public class word2 extends Frame implements MouseListener,Runnable{ TextField sona1=new TextField("blah"); TextField sona2=new TextField("kirjuta siia sama sõna "); TextField aeg=new TextField("- sek"); TextField punktid=new TextField("0"); String sonad[]={"blah", "Kala", "addaasdad","irmuskeeruline","sona","java","seitsmes"}; int sek=0; int punkte=0; public word2(){ setTitle("Words"); setSize(300,100); //setLayout(new BorderLayout()); setLayout(new GridLayout(3,2)); //TextField sona1=new TextField("blah"); Button alusta = new Button("ALUSTA"); add(sona1); //,BorderLayout.WEST); add(sona2); add(aeg); add(punktid); add(alusta); //,BorderLayout.NORTH); alusta.addMouseListener(this); //drawString("kala",200,70); -- sona1.setEditable(false); // muudab väljad mitte-editeeritavaks sona2.setEditable(false); aeg.setEditable(false); punktid.setEditable(false); setVisible(true); //try{Thread.sleep(5000);}catch(Exception e){} ----unekas System.out.println("Init OK."); addWindowListener( // aknakuular akna sulgemiseks klikkides new WindowAdapter(){ public void windowClosing(WindowEvent e){ System.exit(0); } } //windowadapter ); //aken addMouseListener(this); System.out.println("sonad.length: "+sonad.length); } public void mousePressed(MouseEvent e){} public void mouseReleased(MouseEvent e){} public void mouseExited(MouseEvent e){} public void mouseEntered(MouseEvent e){} public void mouseClicked(MouseEvent e){ new Thread(this).start(); } public void run(){ System.out.println("cmd ok"); sona2.setEditable(true); punktid.setText("0"); for(int nr=0; nr