
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.event.*;

public class Primeira_Tela extends JFrame implements ActionListener
{
	JLabel lbl_Mostrar;
	JButton bt_Escrever, bt_Sair, bt_Limpar;
	JPanel Painel_Botoes = new JPanel();

	public Primeira_Tela()
	{
			setLayout(new BorderLayout());			
			add("Center", lbl_Mostrar = new JLabel ("ETIQUETA PARA ÍMPRESSÃO"));	
			add("South", Painel_Botoes = new JPanel ());
			Painel_Botoes.setLayout(new FlowLayout());			
			Painel_Botoes.add(bt_Escrever = new JButton ("ESCREVER"));
			Painel_Botoes.add(bt_Limpar = new  JButton ("LIMPAR"));
			Painel_Botoes.add(bt_Sair = new JButton("SAIR DO SISTEMA"));
			bt_Escrever.addActionListener(this);
			bt_Sair.addActionListener(this);	
			bt_Limpar.addActionListener(this);
			setTitle("Minha Primeira Tela Java");
			setSize(400, 500);
			setVisible(true);			
	}
	public void actionPerformed(ActionEvent e) 
	{
         if(e.getSource()==bt_Sair)
	      {System.exit(0); }	
         if(e.getSource()==bt_Escrever)
	     {lbl_Mostrar.setText("ANDRÉ APARECIDO DA SILVA");}
          if(e.getSource()==bt_Limpar)
          {	
                 lbl_Mostrar.setBackground( new Color(255,255,255) );
	     		lbl_Mostrar.setText("ETIQUETA PARA ÍMPRESSÃO");			
           }
	}

	public static void main (String args [])
	{
		new Primeira_Tela();
	}
	
	
}