/**
 * @(#)Text1.java
 *
 *
 * @author 
 * @version 1.00 2018/3/13
 */

 import java.awt.*; 
import javax.swing.*; 
 import java.awt.event.*; 
import javax.swing.event.*; 
public class Aula0043ati extends JFrame implements ActionListener

{
		JLabel lbl_Nome, lbl_Email;
		JTextField tf_Nome, tf_Email; 
		JButton bt_Adicionar, bt_Limpar, bt_Sair;
		JPanel Painel_1, Painel_2, Painel_3;  
    	public Aula0043ati() 
    	{
    			getContentPane().setLayout(new GridLayout(3,1));
    			getContentPane().add(Painel_1 = new JPanel (new FlowLayout(FlowLayout.LEFT)));
    			Painel_1.add(lbl_Nome = new JLabel("NOME:"));
    			Painel_1.add(tf_Nome= new JTextField(40));
			getContentPane().add(Painel_2 = new JPanel (new FlowLayout(FlowLayout.LEFT)));
                Painel_2.add(lbl_Email = new JLabel("E-MAIL:"));
                Painel_2.add(tf_Email = new JTextField(40));
                getContentPane().add(Painel_3 = new JPanel(new FlowLayout(FlowLayout.CENTER)));
                Painel_3.add(bt_Adicionar = new JButton("ADICIONAR"));
                Painel_3.add(bt_Limpar = new JButton("LIMPAR"));
                Painel_3.add(bt_Sair= new JButton("SAIR"));
                bt_Adicionar.addActionListener(this); 
                bt_Limpar.addActionListener(this); 
                bt_Sair.addActionListener(this); 



    			pack();
    			setVisible(true);
    			
    				
   		}
   		public void actionPerformed (ActionEvent e)
   		{
   			if(e.getSource()==bt_Sair)
   			{
   					System.exit(0);
   			}
   			if(e.getSource()==bt_Limpar)
   			{
   					tf_Nome.setText("");
   					 tf_Email.setText("");
   			}
   			
   		}
   		public static void main (String args [])
   		{
   				new Aula0043ati();
   		}
    
    
}
