import java.awt.*; import java.applet.*; public class Tekstilaatikko extends Applet { TextField lahde, kohde; String sana="hotjava"; public void init() { add(lahde = new TextField(10)); add(kohde = new TextField(10)); add(new Button("Ready")); lahde.setText(sana); kohde.setEchoCharacter('*'); } public boolean action(Event evt, Object arg) { if (evt.target instanceof Button) { // Is the word (sana) right if(lahde.getText().equals(kohde.getText())) lahde.setText("right"); } return true; } }