• Post Reply Bookmark Topic Watch Topic
  • New Topic

JButton with data?  RSS feed

 
ego hu
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When a button is pressed, I need some information(like an int)
to be transffered into the "actionPerformed" function,
but I don't know how can I bind some client data with the button or with the event.
Who can help me?
Thank you.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the int you require is in a JTextField, then you can simply query the text field inside of the actionPerformed event.

If it's in a variable, just use the variable.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!