import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;

public class kureapplet extends Applet implements ActionListener
{
   Label rakametiketi,sonucetiketi;
   TextField rakam,sonuc;

   public void init()
   {
   rakametiketi=new Label("Bir tamsayi giriniz : ");
   rakam=new TextField(10);
   rakam.addActionListener(this);
   sonucetiketi=new Label("Kurenin Hacmi    : ");
   sonuc=new TextField(10);
   sonuc.setEditable(false);
   add(rakametiketi);
   add(rakam);
   add(sonucetiketi);
   add(sonuc);
   }

   public void actionPerformed( ActionEvent e)
   {
   double sayi;
   double sayisi;

   Double sayi1=new Double(e.getActionCommand() );
   sayi=sayi1.doubleValue(); 

   sayisi=hacim(sayi);
   showStatus("hesaplandi....");
   sonuc.setText(Double.toString(sayisi));

   Double sayi2=new Double(e.getActionCommand() );
   sayisi=sayi2.doubleValue(); 
   }

  public static double hacim(double x)
  {
  return (4.0/3.0)*Math.PI*Math.pow(x,3);
  }
}
