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

public class WinCliente extends JFrame 
						implements ActionListener {
							
	JTextField display = new JTextField(20);
	JButton acao = new JButton("Açao");
	View view;
	InterfaceTexto x;
	
	public WinCliente(View v, InterfaceTexto x) {
		view = v;
		this.x = x;
		acao.addActionListener(this);
		Container pane = this.getContentPane();
		pane.add(BorderLayout.NORTH, display);
		pane.add(BorderLayout.SOUTH, acao);
		pack();
		setVisible(true);
	}
	
	public void actionPerformed(ActionEvent e) {
		view.botaoAcao();
		display.setText(view.display());
		x.print(); // disparar impressao
	}
	
	public static void main(String[] args) {
		Model model = new Model();
		View view = new View(model);
		View view2 = new View(model);
		View view3 = new View(model);
		Controller control = new Controller(view, model);
		
		InterfaceTexto x = new InterfaceTexto(view3);
		new WinCliente(view, x);
		new WinCliente(view2, x);
		
	}
}
