This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Adding actions to buttons  RSS feed

 
Roy Mallard
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is an elegant way to add an action to a button?
Currently I pass the controller to the view's constructor so that the view can access all of the controller's actions, but it seems kind of messy to have the controller and view contain references to each other.



Is there a better way?

[ August 03, 2006: Message edited by: Roy Mallard ]
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to our Swing forum. Please keep specifically to SCJD topics in this Forum.
Thanks.
-Barry
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!