Pregunta

I want my textfield become like this “99999”

this is my code

while (rs.next()){
    int s=rs.getInt("Number");
    String num1 = String.valueOf(s);
    String n = String.format("%05d",num1);
    view.txtcustomernumber.setText(n);
}

why my txtcustomernumber(JTextField) always blank

¿Fue útil?

Solución

Try this.

while (rs.next()){
int s=rs.getInt("Number");
String n = String.format("%05d",s);
view.txtcustomernumber.setText(n);
}

It might solve your problem.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top