Question

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

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top