import java.awt.*; import java.awt.event.*; import java.applet.Applet; public class Pall2 extends Applet implements ActionListener{ TextField tf1=new TextField(10); public Pall2(){ add(tf1); tf1.addActionListener(this); } public void actionPerformed(ActionEvent e){ double x=100, y=100, samm=5; double nurk=Math.toRadians( Double.parseDouble(tf1.getText())); Graphics g=getGraphics(); while(x=0){ g.setColor(getForeground()); g.drawOval((int)x, (int)y, 10, 10); try{Thread.sleep(100);}catch(Exception viga){} g.setColor(getBackground()); g.drawOval((int)x, (int)y, 10, 10); x=x+samm*Math.cos(nurk); y=y-samm*Math.sin(nurk); } } public static void main(String arg[]){ Frame f=new Frame("Palli lend"); f.add(new Pall2()); f.setSize(200, 200); f.setVisible(true); } }