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

class H3OD4a
{

public static double kuvvet(double a,double b)
{
double k=1.0;
if(b<0)
{
  for(int i=0;i<(int)(-b);i++)
  {k*=a;}
  k=1.0/k;
}
else if(b==0)
{
   k=1.0;
}
else if(b>0)
{
  for(int i=1;i<=(int)b;i++)
  {k*=a;}
}
  return k;
}

}

public class H3OD4_2000 extends JApplet implements ActionListener
{
    double a;
    double b;
    JLabel s1;
    JTextField t1;
    JLabel s2;
    JTextField t2;
    JTextArea cikti;
	public void init()
	{
	cikti=new JTextArea();
    Container c=getContentPane();
    c.setLayout(new FlowLayout());
    s1=new JLabel("tabani giriniz  : ");
	t1=new JTextField(10);
	s2=new JLabel("kuvveti giriniz : ");
	t2=new JTextField(10);
	cikti=new JTextArea("ilk dešer");
	c.add(s1);
	c.add(t1);
	c.add(s2);
	c.add(t2);
	c.add(cikti);
    t1.addActionListener(this);
    t2.addActionListener(this);
	}

	public void actionPerformed(ActionEvent e)
	{
	    a=Double.parseDouble(t1.getText() );
        b=Double.parseDouble(t2.getText() );
        t1.setText("");
        t2.setText("");
	    cikti.setText("taban "+a+" nin "+b+" inci kuvveti : "+ H3OD4a.kuvvet(a,b));
	    repaint();
	}
 }
