import java.awt.Graphics;
 import java.util.*;
 import java.text.*;
 import java.util.Locale;
 import java.awt.image.*;
 import javax.swing.*;
import java.awt.Graphics;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.awt.font.*;

// ============
public class buttonP extends JPanel implements ActionListener
{ private static final long serialVersionUID =47897468764L;
     JButton jb;
     JTextField jtf;
     int signal;
     public buttonP()
     {
	  setLayout(new BorderLayout());
     jb=new JButton("ışığı yakıp kapatmak için düğmeye basınız");
     jtf=new JTextField("ışık söndü");
     signal=0;
     jb.addActionListener(this);
     add(jb,BorderLayout.NORTH);
     add(jtf,BorderLayout.SOUTH);
     }
     public void actionPerformed( ActionEvent e)
    {   if(e.getSource()==jb)
        {   if(signal==1) {signal=2;}
             else {signal=1;}
        }
     }
}
