• Post Reply Bookmark Topic Watch Topic
  • New Topic

Displaying result in a JTextField

 
Rob Petterson
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can anyone tell me what method I need to use for outputting results into a JTextField?
Say for example in the case of adding 2 numbers together and wanting to display the result in a JTextField???
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JTextField.setText(String) Of course, if you are trying to put numbers in there, you can use the toString() methods of the wrapper classes... like Integer.toString().

 
Rob Petterson
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Nathan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!