Passar dados de um jFrame para o outro
26/10/2015
0
Eu estou passando os dados de um jframe para o outro mas os dados não aparecem no jframe ele não atualiza como resolver isso?
Botão para abrir um novo jFrame de pesquisa
jFrame de pesquisa
Botão para abrir um novo jFrame de pesquisa
private void jBBuscaClienteActionPerformed(java.awt.event.ActionEvent evt) { FrmBuscarPaciente frm = null; try { frm = new FrmBuscarPaciente(); } catch (SQLException ex) { Logger.getLogger(FrmAtendimento.class.getName()).log(Level.SEVERE, null, ex); } frm.toFront(); frm.setVisible(true); }
jFrame de pesquisa
private void jTablePacienteMouseClicked(java.awt.event.MouseEvent evt) { if(enviaTexto == null){ int id = ((int) jTablePaciente.getValueAt(jTablePaciente.getSelectedRow(), 0)); String nome = "" + jTablePaciente.getValueAt(jTablePaciente.getSelectedRow(), 1); String cpf = ""+ jTablePaciente.getValueAt(jTablePaciente.getSelectedRow(), 2); String id2 = ""+ id; try { enviaTexto = new FrmAtendimento(); enviaTexto.recebendo(nome); enviaTexto.recebendo2(id2); enviaTexto.setVisible(true); dispose(); } catch (SQLException ex) { Logger.getLogger(FrmBuscarPaciente.class.getName()).log(Level.SEVERE, null, ex); } }else{ //enviaTexto.setVisible(true); //enviaTexto.setState(FrmAtendimento.NORMAL); dispose(); } } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { if(enviaTexto == null){ int id = ((int) jTablePaciente.getValueAt(jTablePaciente.getSelectedRow(), 0)); String nome = "" + jTablePaciente.getValueAt(jTablePaciente.getSelectedRow(), 1); String cpf = ""+ jTablePaciente.getValueAt(jTablePaciente.getSelectedRow(), 2); String id2 = ""+ id; try { enviaTexto = new FrmAtendimento(); enviaTexto.recebendo(nome); enviaTexto.recebendo2(id2); enviaTexto.setVisible(true); dispose(); } catch (SQLException ex) { Logger.getLogger(FrmBuscarPaciente.class.getName()).log(Level.SEVERE, null, ex); } }else{ // enviaTexto.setVisible(true); enviaTexto.setState(FrmAtendimento.NORMAL); } }
Adriano Silva
Curtir tópico
+ 0
Responder
Clique aqui para fazer login e interagir na Comunidade :)