import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class Vista extends JPanel{
	JTextField textoNombre;
	JTextField textoDinero;
	JTextField textoFecha;
	JTextField insertarNombre;
	JTextField insertarDinero;
	JTextField insertarFecha;
	JButton mostrarTodo;
	JButton aniadir;
	JButton editar;
	JButton eliminar;
	JButton buscar;
	JTextField textoNombreViejo;
	JTextField insertarNombreViejo;
	
	public Vista() {
		this.setLayout(new GridBagLayout());
		GridBagConstraints constrain = new GridBagConstraints();
		this.textoNombre = new JTextField("nombre");
		this.textoNombre.setEditable(false);
		constrain.gridx = 0;
		constrain.gridy = 0;
		this.add(this.textoNombre, constrain);
		this.textoDinero = new JTextField("dinero");
		this.textoDinero.setEditable(false);
		constrain.gridx = 0;
		constrain.gridy = 1;
		this.add(this.textoDinero, constrain);
		this.textoFecha = new JTextField("fecha");
		this.textoFecha.setEditable(false);
		constrain.gridx = 0;
		constrain.gridy = 2;
		this.add(this.textoFecha, constrain);
		
		this.insertarNombre = new JTextField("nombre");
		constrain.gridx = 1;
		constrain.gridy = 0;
		this.add(this.insertarNombre, constrain);
		this.insertarDinero = new JTextField("dinero");
		constrain.gridx = 1;
		constrain.gridy = 1;
		this.add(this.insertarDinero, constrain);
		this.insertarFecha = new JTextField("fecha");
		constrain.gridx = 1;
		constrain.gridy = 2;
		this.add(this.insertarFecha, constrain);
		
		this.aniadir = new JButton("aniadir");
		constrain.gridx = 0;
		constrain.gridy = 3;
		this.add(this.aniadir, constrain);
		this.editar = new JButton("editar");
		constrain.gridx = 1;
		constrain.gridy = 3;
		this.add(this.editar, constrain);
		this.mostrarTodo = new JButton("mostrar todo");
		constrain.gridx = 2;
		constrain.gridy = 3;
		this.add(this.mostrarTodo, constrain);
		this.eliminar = new JButton("eliminar");
		constrain.gridx = 3;
		constrain.gridy = 3;
		this.add(eliminar, constrain);
		this.buscar = new JButton("buscar");
		constrain.gridx = 4;
		constrain.gridy = 3;
		this.add(buscar, constrain);
		
		this.textoNombreViejo = new JTextField("id a cabiar");
		this.textoNombreViejo.setEditable(false);
		constrain.gridx = 0;
		constrain.gridy = 4;
		this.add(this.textoNombreViejo, constrain);
		this.insertarNombreViejo = new JTextField("id a cambiar");
		constrain.gridx = 1;
		constrain.gridy = 4;
		this.add(this.insertarNombreViejo, constrain);
	}
}
