6
My doubt is simple, I believe. 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, is a query command by CPF where I want to return the customer 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);
}
You call Cadastrogui another screen and want it to be filled with information from the previous screen?
– user28595
I have the template Registration ready, so I want to make a query through the CPF in another interface, call the Registration when filling the CPF and press a jbutton
procurar
and receive the information alreadysetadas
in the register that will be called– Letícia Ramos Silva
When I put this Cadasgui d = new Cadastrogui(); d.setVisible(true); it is coming, but it is not filled. I want it to be filled with the information that is connected to the CPF that I will look for.
– Letícia Ramos Silva
This information comes from the screen that calls Cadasgui or you already bring direct from the bank?
– user28595
careful when using the word interface in this way, in java it has another meaning. How do you send the information to Cadastrogui? it is a Jframe?
– Skywalker
What @Skywalker said is true. I suggest you edit the question title to "graphical interface" since we’re talking about GUI’s.
– user28595
I am learning more and more from you because I am a beginner in kk programming. I bring from the bank @Diegofelipe.
– Letícia Ramos Silva
It’s Jframe yes @Skywalker, the information filled in in Jtextfields.
– Letícia Ramos Silva
send the information you want to display in Cadastrogui by a constructor. Build a constructor in Cadastrogui.
– Skywalker