Java have a int value using setText

后端 未结 7 988
梦如初夏
梦如初夏 2021-01-28 03:02

I\'m trying to set an int value using jTextField and the setText method. But of course setText wants a String. How do I get round this? I\'ll give you a snippet of the code:

相关标签:
7条回答
  • 2021-01-28 04:06

    USe

    seatsTF.setText(""+e.getNoOfSeats());
    

    OR

    seatsTF.setText(String.valueOf(e.getNoOfSeats()));
    
    0 讨论(0)
提交回复
热议问题