}// </editor-fold>//GEN-END:initComponents
private void jButtonCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCadastrarActionPerformed
//Insere o novo paciente
SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy");
Paciente novo = new Paciente();
novo.setRG(jTextFieldRG.getText());
novo.setEmail(jTextFieldEmail.getText());
novo.setEndereco(jTextFieldEndereco.getText());
novo.setNome(jTextFieldNome.getText());
novo.setTelefone(jTextFieldTelefone.getText());
java.util.Date data = new java.util.Date();
novo.setCadastro(new Date(data.getTime()));
try {
novo.setNascimento(new java.sql.Date(formato.parse(jFormattedTextFieldDataNascimento.getText()).getTime()));
} catch (ParseException ex) {
Logger.getLogger(Cadastro.class.getName()).log(Level.SEVERE, null, ex);
}
novo.save();
//Volta para o menu principal
CardLayout cardLayout = (CardLayout) this.getParent().getLayout();
cardLayout.show(getParent(),JanelaDaAplicacao.MENUPRINCIPAL);
}//GEN-LAST:event_jButtonCadastrarActionPerformed