import java.applet.Applet; import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; public class kiri extends Applet implements ActionListener{ TextField kala=new TextField("kirjuta siia"); Button nupp=new Button(" OK "); public void init(){ add(kala); add(nupp); nupp.addActionListener(this); } public void actionPerformed(ActionEvent e){ String sona=kala.getText(); int nr=sona.length(); Graphics g=this.getGraphics(); g.setColor(Color.white); g.fillRect(0, 0, getSize().width, getSize().height); g.setColor(Color.red); g.setFont(new Font("Terminal", Font.PLAIN, 300/nr)); g.drawString(sona, 20, 250); } }