import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class H2AL7_2000 extends JApplet implements ActionListener
{  int sayi1,sayi2,sayi3;
   int toplam;
   double ort;
   JLabel s1,s2,s3;     //yazę alanlari sinifi
   JTextField t1,t2,t3;    //girdi alanlari (kutulari)
   JTextArea ciktiAlani;
   //pencereyi baslatma metotu
   public void init()
   {
      Container c=getContentPane();
      c.setLayout(new FlowLayout());
      Color renk=c.getBackground();
      s1=new JLabel("den");
      s2=new JLabel("e kadar ");
      s3=new Label("er sayilarin toplami : ");
      Font f=s1.getFont();
      Color r1=s1.getForeground();
      t1=new JTextField(5);  //pencereye ekle
      t2=new JTextField(5);  //pencereye ekle
      t3=new JTextField(5);  //pencereye ekle

      ciktiAlani=new JTextArea();
      t1.setBackground(renk);
      t1.setForeground(r1);
      t2.setBackground(renk);
      t2.setForeground(r1);
      t2.setBackground(renk);
      t2.setForeground(r1);
      t1.setFont(f);
      t2.setFont(f);
      t3.setFont(f);
      ciktiAlani.setForeground(r1);
      ciktiAlani.setBackground(renk);
      ciktiAlani.setFont(f);
      c.add(s1);
      c.add(t1);
      c.add(s2);
      c.add(t2);
      c.add(s3);
      c.add(t3);

      c.add(ciktiAlani);
      t3.addActionListener(this);

   }
   //girdi alanindan sinyal bekle ve sinyal gelince su islemleri yap
   public void actionPerformed(ActionEvent e)
   {
      toplam=0;  //sayi1 i kutulardan oku
      sayi1=Integer.parseInt(t1.getText());
      sayi2=Integer.parseInt(t1.getText());
      sayi3=Integer.parseInt(t1.getText());
      int i=1;
      for(int i=sayi1;i<=sayi2;i+=sayi3)
      {
      toplam+=i;
      }
      ciktiAlani.setText(""+sayi1+"den "+sayi2+"e kadar sayilarin "+
      sayi3+"er "+sayi3+"er toplami :"+toplam);
      repaint();
    }
      //ActionPerformed metotunun kapanisi
} //H2OD3 sinifinin kapanisi