112 lines
3.3 KiB
Java
112 lines
3.3 KiB
Java
import java.awt.Dimension;
|
|
import java.awt.GridBagConstraints;
|
|
import java.awt.GridBagLayout;
|
|
|
|
import javax.swing.JButton;
|
|
import javax.swing.JPanel;
|
|
import javax.swing.JPasswordField;
|
|
import javax.swing.JTabbedPane;
|
|
import javax.swing.JTextField;
|
|
|
|
public class VistaAniadir extends JPanel{
|
|
JTabbedPane pestanias;
|
|
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;
|
|
JTextField titulopPasswd;
|
|
JPasswordField pass;
|
|
JButton cargarPasswd;
|
|
|
|
/**
|
|
* Carga la vista en la que aniadir datos
|
|
*/
|
|
public VistaAniadir() {
|
|
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();
|
|
this.insertarNombre.setPreferredSize(new Dimension(80, 17));
|
|
constrain.gridx = 1;
|
|
constrain.gridy = 0;
|
|
this.add(this.insertarNombre, constrain);
|
|
this.insertarDinero = new JTextField();
|
|
this.insertarDinero.setPreferredSize(new Dimension(80, 17));
|
|
constrain.gridx = 1;
|
|
constrain.gridy = 1;
|
|
this.add(this.insertarDinero, constrain);
|
|
this.insertarFecha = new JTextField();
|
|
this.insertarFecha.setPreferredSize(new Dimension(80, 17));
|
|
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.mostrarTodo = new JButton("mostrar todo");
|
|
constrain.gridx = 1;
|
|
constrain.gridy = 3;
|
|
this.add(this.mostrarTodo, constrain);
|
|
|
|
this.textoNombreViejo = new JTextField("id seleccionado");
|
|
this.textoNombreViejo.setEditable(false);
|
|
constrain.gridx = 0;
|
|
constrain.gridy = 4;
|
|
this.add(this.textoNombreViejo, constrain);
|
|
this.insertarNombreViejo = new JTextField();
|
|
this.insertarNombreViejo.setPreferredSize(new Dimension(80, 17));
|
|
constrain.gridx = 1;
|
|
constrain.gridy = 4;
|
|
this.add(this.insertarNombreViejo, constrain);
|
|
this.eliminar = new JButton("eliminar");
|
|
constrain.gridx = 2;
|
|
constrain.gridy = 4;
|
|
this.add(eliminar, constrain);
|
|
this.buscar = new JButton("buscar");
|
|
constrain.gridx = 3;
|
|
constrain.gridy = 4;
|
|
this.add(buscar, constrain);
|
|
|
|
this.titulopPasswd = new JTextField("Cambiar DB passwd");
|
|
this.titulopPasswd.setEditable(false);
|
|
constrain.gridx = 0;
|
|
constrain.gridy = 5;
|
|
this.add(this.titulopPasswd,constrain);
|
|
this.pass = new JPasswordField();
|
|
this.pass.setPreferredSize(new Dimension(80, 17));
|
|
constrain.gridx = 1;
|
|
constrain.gridy = 5;
|
|
this.add(this.pass,constrain);
|
|
this.cargarPasswd = new JButton("cambiar");
|
|
constrain.gridx = 2;
|
|
constrain.gridy = 5;
|
|
this.add(this.cargarPasswd,constrain);
|
|
}
|
|
}
|