문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top