My doubt is simple, I think. I need to call this interface CadastroGUI d = new CadastroGUI()
; which I already have ready, but I want the fields already appear filled, after all, it is a query command by CPF where I want to return the client information.
The Code
public void actionPerformed(ActionEvent arg0) {
String cpf = txtCPF.getText();
DaoCadastro c = new DaoCadastro();
ArrayList <Cadastro> co = new ArrayList <Cadastro>();
CadastroGUI d = new CadastroGUI();
d.setVisible(true);
co = c.listaAlterar(cpf);
int a=0;
for (a=0; a<co.size();a++)
{
txtNome.setText (co.get(a).Nome);
txtCPF.setText (co.get(a).CPF);
txtEndereco.setText(co.get(a).Endereco);
txtSexo.setText(co.get(a).Sexo);
txtDataNasc.setText (co.get(a).Datanasc);
}