I created a simple jFrame with a jDialog, in this jDialog I have textfield just to get an ID, them, with this ID, use a webservice to search for the information and them show the information in the jFrame, however, all textfields that I use on my jFrame, do not setText()
, why this happens and how can I fix it?
Here's the code where i use the webservice and show the information:
public void Buscar () throws Exception {
InterfaceConsu2 IFC2 = new InterfaceConsu2();
ConsumirWS2 http = new ConsumirWS2();
Gson g = new GsonBuilder().setDateFormat("dd-MM-yyyy").create();
Cliente2 u = new Cliente2();
Type ClienteType = new TypeToken<Cliente2>() {
}.getType();
u.setCad_pes_cpf(DialogCPF.jFormattedTextField1.getText());
String url = "http://localhost:8080/clienteWebService/webresources/CadastroCliente/Cliente/get/"+u.getCad_pes_cpf();
String json = http.sendGet(url, "GET");
u = g.fromJson(json, ClienteType);
System.out.println(json + ("\n"));
System.out.println(u.getcad_pes_nome() +("\n") + u.getCad_pes_apelido() +("\n") + u.getCad_pes_cpf() +("\n") + u.getCad_pes_data()+("\n"));
String Date1 = new SimpleDateFormat("dd-MM-yyyy").format(u.getCad_pes_data());
System.out.println(Date1);
IFC2.jTextFieldNOME.setText(u.getcad_pes_nome());
IFC2.jTextFieldAPELIDO.setText(u.getCad_pes_apelido());
IFC2.jFormattedTextFieldCPF.setText(u.getCad_pes_cpf());
IFC2.jFormattedTextFieldDATA.setText(Date1);
IFC2.jTextFieldID.setText(u.getcad_pes_id());
}
using the System.out.println(u.getcad_pes_nome() +("\n") + u.getCad_pes_apelido() +("\n") + u.getCad_pes_cpf() +("\n") + u.getCad_pes_data()+("\n"));
I receive all the information and show on the console, but, in my jFrame don't