Erro detailTable Endereço

0 respostas
J

Olá, pessoal, estou com problemas no form detailTable de endereço do cliente que é vinculada a tabela de cliente, fiz a de endereço chamando um form Jdialog ao clicar em inserir, queria que ela fosse sincronizada com jtable, ao ir digitando, entende, só que não está dando certo, vejam figura....abaixo...

private void newDetailButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                

        int index = masterTable.getSelectedRow();
        br.com.gyncom.bean.Cliente c = list.get(masterTable.convertRowIndexToModel(index));
        Collection<br.com.gyncom.bean.EnderecoCliente> es = c.getEnderecoClienteCollection();
        if (es == null) {
            es = new LinkedList<br.com.gyncom.bean.EnderecoCliente>();
            c.setEnderecoClienteCollection(es);
        }
        br.com.gyncom.bean.EnderecoCliente e = new br.com.gyncom.bean.EnderecoCliente();
        entityManager.persist(e);
        e.setCodCliente(c);
        es.add(e);
        int row = es.size()-1; 
        masterTable.clearSelection();
        masterTable.setRowSelectionInterval(index, index);
        detailTable.setRowSelectionInterval(row, row);
        detailTable.scrollRectToVisible(detailTable.getCellRect(row, 0, true));
        
        JFrame frame = new JFrame();
        ClienteEndView ce = new ClienteEndView(frame, true);
        ce.setRegistroEndcliente(e);
        ce.setVisible(true);
        
          if (ce.isConfirmaEndereco()){
            saveButton.doClick();
        } else {
            refreshButton.doClick();
        } 
      
    }

Ex...ENDEREÇO: RUA X

dai ela teria que sair na jtable endereço em tempo de execução, já refiz esse código tirando a declaração Jframe, e alterando a propriedade RegistroEndClasse na classe...vejam abaixo como tá...

public void setRegistroEndcliente(EnderecoCliente registroEndcliente) {
        EnderecoCliente oldRecord = this.registroEndcliente;      
        this.registroEndcliente = registroEndcliente;
       //propertyChangeSupport.firePropertyChange("registroEndCliente", oldRecord, registroEndcliente);
        propertyChangeSupport.firePropertyChange("registroEndCliente", oldRecord, registroEndcliente);
    }
    private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);

alguém pode me da um help....

junera

Criado 31 de maio de 2009
Respostas 0
Participantes 1