import java.awt.*;
import java.awt.event.*;
import java.util.*;

public class workflow extends java.applet.Applet implements ActionListener
{

public static Panel toolbar;
Button addE;
Button addL;
private Label lblTeste;
private Label lblTeste2;

public void actionPerformed(ActionEvent evt)
	{
	Object src = evt.getSource();
		if(src==addE)
		{
			//Remove o label
			toolbar.remove(lblTeste2);
			try {
				toolbar.validate();
				toolbar.repaint();
			} catch (Exception e) {
				System.out.println("erro --> " + e);
			}

			lblTeste.setText("teste de label - botão A");
		}

		if(src==addL)
		{
			lblTeste.setText("teste de label - botão B");

			//Adiciona o label
			toolbar.add(lblTeste2);
			try {
				toolbar.validate();
				toolbar.repaint();
			} catch (Exception e) {
				System.out.println("erro --> " + e);
			}
			

			
			
		}
	}
public void init()
{
	lblTeste = new Label("");
	lblTeste.setSize(300,150);
	this.setLayout(new BorderLayout());
	this.add("Center",lblTeste);
	toolbar = new Panel();
	//toolbar.setLayout(new BorderLayout());
	addE = new Button("Adicionar AAA");
	addL = new Button("Adicionar BBB");
	addE.addActionListener(this);
	addL.addActionListener(this);
	toolbar.add(addE);
	toolbar.add(addL);
	this.add("North",toolbar);
	lblTeste2 = new Label("teste2");


}
}
