Vinculação de Propriedades

0 respostas
E

Olá.
Preciso fazer a vinculação de Atributos de um POJO com os componentes de um JPanel, isso é possível, alguém tem algum tutorial?
Encontrei um tutorial no site do netbeans porém ele só mostra como vincular propriedades de objetos na mesma classe.

Meu POJO:
public class Usuario
{
    private int codUsuario;
    private String logUsuario;
    private int codPerfil;
    private String nomeUsuario;
    private String passUsuario;
    private Time hrIAcesso;
    private Time hrFAcesso;
    private String sobHrPerfil;
    private Date dataInc;
    private Date dataAlt;
    private Date dataExc;
    private String ativo;
    private int codUsuAlt;

    public String getAtivo() {
        return ativo;
    }

    public void setAtivo(String ativo) {
        this.ativo = ativo;
    }

    public int getCodPerfil() {
        return codPerfil;
    }

    public void setCodPerfil(int codPerfil) {
        this.codPerfil = codPerfil;
    }

    public int getCodUsuAlt() {
        return codUsuAlt;
    }

    public void setCodUsuAlt(int codUsuAlt) {
        this.codUsuAlt = codUsuAlt;
    }

    public int getCodUsuario() {
        return codUsuario;
    }

    public void setCodUsuario(int codUsuario) {
        this.codUsuario = codUsuario;
    }

    public Time getHrFAcesso() {
        return hrFAcesso;
    }

    public void setHrFAcesso(Time hrFAcesso) {
        this.hrFAcesso = hrFAcesso;
    }

    public Time getHrIAcesso() {
        return hrIAcesso;
    }

    public void setHrIAcesso(Time hrIAcesso) {
        this.hrIAcesso = hrIAcesso;
    }

    public String getLogUsuario() {
        return logUsuario;
    }

    public void setLogUsuario(String logUsuario) {
        this.logUsuario = logUsuario;
    }

    public String getNomeUsuario() {
        return nomeUsuario;
    }

    public void setNomeUsuario(String nomeUsuario) {
        this.nomeUsuario = nomeUsuario;
    }

    public String getPassUsuario() {
        return passUsuario;
    }

    public void setPassUsuario(String passUsuario) {
        this.passUsuario = passUsuario;
    }

    public String getSobHrPerfil() {
        return sobHrPerfil;
    }

    public void setSobHrPerfil(String sobHrPerfil) {
        this.sobHrPerfil = sobHrPerfil;
    }

    public Date getDataAlt() {
        return dataAlt;
    }

    public Date getDataExc() {
        return dataExc;
    }

    public Date getDataInc() {
        return dataInc;
    }
    
 }
Minha Classe JPanel:
public class pnFichaUsuario extends javax.swing.JPanel {

    private Usuario usuario = new Usuario();

    /** Creates new form pnFichaUsuario */
    public pnFichaUsuario() {
        initComponents();
    }

    public JComboBox getCbPerfil() {
        return cbPerfil;
    }

    public JCheckBox getCheckAtivo() {
        return checkAtivo;
    }

    public JCheckBox getCheckSobHrPerfil() {
        return checkSobHrPerfil;
    }

    public JFormattedTextField getTfHrFAcesso() {
        return tfHrFAcesso;
    }

    public JFormattedTextField getTfHrIAcesso() {
        return tfHrIAcesso;
    }

    public JTextField getTfLogUsuario() {
        return tfLogUsuario;
    }

    public JTextField getTfNomeUsuario() {
        return tfNomeUsuario;
    }

    public JPasswordField getTfPassUsuario() {
        return tfPassUsuario;
    }


    private void initComponents() {}// Gerado pelo Netbeans                     


    // Variables declaration - do not modify                     
    private javax.swing.JComboBox cbPerfil;
    private javax.swing.JCheckBox checkAtivo;
    private javax.swing.JCheckBox checkSobHrPerfil;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JFormattedTextField tfHrFAcesso;
    private javax.swing.JFormattedTextField tfHrIAcesso;
    private javax.swing.JTextField tfLogUsuario;
    private javax.swing.JTextField tfNomeUsuario;
    private javax.swing.JPasswordField tfPassUsuario;
    // End of variables declaration                   

}
Criado 26 de março de 2009
Respostas 0
Participantes 1