Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how do i generate an ActionEvent ?  RSS feed

 
A Wu
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do i invoke an actionperformed method associated with a button manually?
i want to execute the actionperformed method when the application starts.
tia
 
Jason Steele
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Constructor:
 
Jason Steele
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note:
you do not have to call button.doClick() from the constructor. It can be called from another method. However, if you want the button to invoke actions on startup, you will have to define the actionListener in the constructor or in a method called by the constructor.
 
A Wu
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jason !
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!