-1
When printing customer data in Jtextfield, when the \n
is present means a line break, but instead of moving to the next line each time you find a \n
, he simply ignores and continues to write in front.
Follow the code below:
lista.setText(clientes[i].toString());
public String toString(){
return String.format("\t-----------------------Cliente Regular-------------------------\n[%s]\t-> Nome: %s\n\t->Contacto: %s\n\t->NIF: %d\n\t->E-email: %s\n\t->Morada: %s\n",super.getnickname(),super.getnome(),super.getcontacto(),super.getnif(),super.getemail(),super.getmorada());
}
And your output should be something like:
"\t-----------------------Cliente Regular-------------------------\n
[%s]\t-> Nome: %s\n
\t->Contacto: %s\n
\t->NIF: %d\n
\t->E-email: %s\n
\t->Morada: %s\n"
Can someone help me?
If the string text is written manually, it is no longer easy to delete the n?
– Ricardo Rodrigues de Faria
the image couldn’t see João, only the one logged in will be able to see. Stack Overflow has its own image Uploader above the editor.
– Chun