public FrmAlumnosFoto() throws SQLException {
		super("Alumnos");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 554, 396);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		
		JPanel pnlAlumno = new JPanel();
		pnlAlumno.setBorder(new TitledBorder(null, "Alumno", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		
		jfcFtoto = new JFileChooser();
		filtro = new FileNameExtensionFilter("Podes subir GIF, JPG o PNG", "JPEG", "JPG", "jpg", "jpeg", "GIF", "gif", "PNG", "png");
		jfcFtoto.setFileFilter(filtro);
		
		pnlAcciones = new JPanel();
		pnlAcciones.setBorder(new TitledBorder(null, "Acciones", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		GroupLayout gl_contentPane = new GroupLayout(contentPane);
		gl_contentPane.setHorizontalGroup(
			gl_contentPane.createParallelGroup(Alignment.LEADING)
				.addComponent(pnlAcciones, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
				.addComponent(pnlAlumno, GroupLayout.DEFAULT_SIZE, 507, Short.MAX_VALUE)
		);
		gl_contentPane.setVerticalGroup(
			gl_contentPane.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_contentPane.createSequentialGroup()
					.addComponent(pnlAlumno, GroupLayout.PREFERRED_SIZE, 211, GroupLayout.PREFERRED_SIZE)
					.addPreferredGap(ComponentPlacement.RELATED)
					.addComponent(pnlAcciones, GroupLayout.DEFAULT_SIZE, 105, Short.MAX_VALUE))
		);
		
		btnPrimero = new JButton("<<");
		btnPrimero.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		
		btnAnterior = new JButton("<");
		
		btnSiguiente = new JButton(">");
		
		btnUltimo = new JButton(">>");
		
		btnAgregar = new JButton("Agregar");
		btnAgregar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				activarTexto(true);
				activarBotones(false);
				activarNavegar(false);
				btnExaminar.setEnabled(true);
				btnGuardar.setEnabled(true);
				limpiarTexto();
				operacionActualizar = opAbm.INSERTAR;
			}

			
		});
		
		btnModificar = new JButton("Modificar");
		btnModificar.setEnabled(false);
		btnModificar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				operacionActualizar = opAbm.MODIFICAR;
				activarTexto(true);
				activarBotones(false);
				btnGuardar.setEnabled(true);
				btnExaminar.setEnabled(true);
			}
		});
		
		btnBorrar = new JButton("Borrar");
		btnBorrar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				operacionActualizar = opAbm.BORRAR;
				try {
					
						abm(opAbm.BORRAR);
					
				} catch (FileNotFoundException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				} catch (SQLException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}
			}
		});
		btnBorrar.setEnabled(false);
		
		btnGuardar = new JButton("Guardar");
		btnGuardar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				try {
					switch (operacionActualizar) {
					case INSERTAR:
						if (validar()) {
							abm(opAbm.INSERTAR);
							limpiarTexto();
							btnAgregar.setEnabled(true);
							activarNavegar(true);
							lblFechaNac.setText(null);
						}else{
							JOptionPane.showMessageDialog(null, "Todos los campos son obligatorios");
							txtNombre.setFocusable(true);
							}
						break;
					case MODIFICAR:
						abm(opAbm.MODIFICAR);
						break;
					}
					
					System.out.println(operacionActualizar);
					activarBotones(true);
					btnGuardar.setEnabled(false);
					activarTexto(false);
					
				} catch (FileNotFoundException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				} catch (SQLException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}
			}
		});
		btnGuardar.setEnabled(false);
		GroupLayout gl_pnlAcciones = new GroupLayout(pnlAcciones);
		gl_pnlAcciones.setHorizontalGroup(
			gl_pnlAcciones.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_pnlAcciones.createSequentialGroup()
					.addGroup(gl_pnlAcciones.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_pnlAcciones.createSequentialGroup()
							.addGap(46)
							.addComponent(btnAgregar, GroupLayout.PREFERRED_SIZE, 92, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(btnModificar, GroupLayout.PREFERRED_SIZE, 92, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(btnBorrar, GroupLayout.PREFERRED_SIZE, 92, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(btnGuardar, GroupLayout.PREFERRED_SIZE, 92, GroupLayout.PREFERRED_SIZE))
						.addGroup(gl_pnlAcciones.createSequentialGroup()
							.addGap(128)
							.addComponent(btnPrimero)
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addComponent(btnAnterior, GroupLayout.PREFERRED_SIZE, 44, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addComponent(btnSiguiente, GroupLayout.PREFERRED_SIZE, 44, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addComponent(btnUltimo)))
					.addContainerGap(65, Short.MAX_VALUE))
		);
		gl_pnlAcciones.setVerticalGroup(
			gl_pnlAcciones.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_pnlAcciones.createSequentialGroup()
					.addGroup(gl_pnlAcciones.createParallelGroup(Alignment.BASELINE)
						.addComponent(btnPrimero)
						.addComponent(btnAnterior)
						.addComponent(btnSiguiente)
						.addComponent(btnUltimo))
					.addGap(18)
					.addGroup(gl_pnlAcciones.createParallelGroup(Alignment.LEADING)
						.addComponent(btnBorrar, Alignment.TRAILING)
						.addComponent(btnModificar, Alignment.TRAILING)
						.addComponent(btnAgregar, Alignment.TRAILING)
						.addComponent(btnGuardar, Alignment.TRAILING))
					.addContainerGap(16, Short.MAX_VALUE))
		);
		pnlAcciones.setLayout(gl_pnlAcciones);
		
		JLabel lblNombre = new JLabel("Nombre");
		
		txtNombre = new JTextField();
		txtNombre.setEnabled(false);
		txtNombre.setColumns(10);
		
		JLabel lblApellido = new JLabel("Apellido");
		
		txtApellido = new JTextField();
		txtApellido.setEnabled(false);
		txtApellido.setColumns(10);
		
		pnlFoto = new JPanel();
		pnlFoto.setBorder(new TitledBorder(null, "Foto", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		
		lblExaminar = new JLabel("Foto");
		
		txtTxtfoto = new JTextField();
		txtTxtfoto.setEnabled(false);
		txtTxtfoto.setColumns(10);
		
		btnExaminar = new JButton("examinar");
		btnExaminar.setEnabled(false);
		
		btnExaminar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				int valor = jfcFtoto.showDialog(btnExaminar, "Agregá la foto");
				if(valor == JFileChooser.APPROVE_OPTION){
					txtTxtfoto.setText(jfcFtoto.getSelectedFile().getPath());
					archivo = new File(jfcFtoto.getSelectedFile().getAbsolutePath());
				    ImageIcon fot = new ImageIcon(jfcFtoto.getSelectedFile().getAbsolutePath());
				    Icon icono = new ImageIcon(fot.getImage().getScaledInstance(lblFoto.getWidth(), lblFoto.getHeight(), Image.SCALE_DEFAULT));
				    lblFoto.setIcon(icono);
				}
			}
		});
		
		lblId = new JLabel("ID");
		
		txtID = new JTextField();
		txtID.setEnabled(false);
		txtID.setColumns(10);
		
		lblFechaNac = new JLabel("fecha nac");
		cboFechaNac = new JCalendarCombo();
		cboFechaNac.setEnabled(false);
		cboFechaNac.setEditable(true);
		
		GroupLayout gl_pnlAlumno = new GroupLayout(pnlAlumno);
		gl_pnlAlumno.setHorizontalGroup(
			gl_pnlAlumno.createParallelGroup(Alignment.TRAILING)
				.addGroup(Alignment.LEADING, gl_pnlAlumno.createSequentialGroup()
					.addContainerGap()
					.addGroup(gl_pnlAlumno.createParallelGroup(Alignment.LEADING)
						.addComponent(lblFechaNac)
						.addGroup(gl_pnlAlumno.createParallelGroup(Alignment.TRAILING, false)
							.addGroup(Alignment.LEADING, gl_pnlAlumno.createSequentialGroup()
								.addGap(76)
								.addComponent(cboFechaNac, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
							.addGroup(Alignment.LEADING, gl_pnlAlumno.createSequentialGroup()
								.addGroup(gl_pnlAlumno.createParallelGroup(Alignment.LEADING)
									.addComponent(lblId)
									.addComponent(lblNombre)
									.addComponent(lblApellido, GroupLayout.PREFERRED_SIZE, 66, GroupLayout.PREFERRED_SIZE)
									.addComponent(lblExaminar))
								.addPreferredGap(ComponentPlacement.UNRELATED)
								.addGroup(gl_pnlAlumno.createParallelGroup(Alignment.LEADING, false)
									.addComponent(txtID)
									.addComponent(txtNombre)
									.addComponent(txtApellido)
									.addGroup(gl_pnlAlumno.createSequentialGroup()
										.addComponent(txtTxtfoto, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
										.addGap(18)
										.addComponent(btnExaminar, GroupLayout.PREFERRED_SIZE, 129, GroupLayout.PREFERRED_SIZE))))))
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addComponent(pnlFoto, GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE))
		);
		gl_pnlAlumno.setVerticalGroup(
			gl_pnlAlumno.createParallelGroup(Alignment.TRAILING)
				.addGroup(gl_pnlAlumno.createSequentialGroup()
					.addGroup(gl_pnlAlumno.createParallelGroup(Alignment.TRAILING)
						.addComponent(pnlFoto, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE)
						.addGroup(gl_pnlAlumno.createSequentialGroup()
							.addGap(0, 22, Short.MAX_VALUE)
							.addGroup(gl_pnlAlumno.createParallelGroup(Alignment.BASELINE)
								.addComponent(txtID, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addComponent(lblId))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(gl_pnlAlumno.createParallelGroup(Alignment.TRAILING)
								.addComponent(lblNombre)
								.addComponent(txtNombre, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(gl_pnlAlumno.createParallelGroup(Alignment.TRAILING)
								.addComponent(lblApellido)
								.addComponent(txtApellido, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addGroup(gl_pnlAlumno.createParallelGroup(Alignment.TRAILING)
								.addComponent(lblExaminar)
								.addGroup(gl_pnlAlumno.createParallelGroup(Alignment.BASELINE)
									.addComponent(txtTxtfoto, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
									.addComponent(btnExaminar)))
							.addGap(18)
							.addGroup(gl_pnlAlumno.createParallelGroup(Alignment.BASELINE)
								.addComponent(lblFechaNac)
								.addComponent(cboFechaNac, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))))
					.addGap(16))
		);
		pnlFoto.setLayout(new GridLayout(0, 1, 0, 0));
		
		lblFoto = new JLabel("");
		lblFoto.setToolTipText("Foto");
		lblFoto.setSize(200, 200);
		pnlFoto.add(lblFoto);
		pnlAlumno.setLayout(gl_pnlAlumno);
		contentPane.setLayout(gl_contentPane);
		
		String sql = "SELECT id, nombre, apellido, fecha_nac, foto FROM personas order by id";
		stm = ManejadorBD.con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
				ResultSet.CONCUR_UPDATABLE);
		res = stm.executeQuery(sql);
		
		
		//res.next();
				
		accionDeplazar(btnPrimero);
		accionDeplazar(btnAnterior);
		accionDeplazar(btnSiguiente);
		accionDeplazar(btnUltimo);
	}