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

EventHandler class and enabling other Component  RSS feed

Mark Spritzler
Posts: 17309
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, so using the EventHandler class I can enable or disable another JComponent when an Action occurs on some other JComponent using the create method, and that is great. Now my question is, is there a way to enable or disable based on specific values from the JComponent where it Action is fired.

Now I can have the EventHandler call a method on the Listener, and could use this, but do you think this method it calls should be within the view class, or should it still be outside the view class in its own class.

Well, just thinking out loud, how will the outside class have a reference to the other JComponent that needs to be disabled or enabled.

I think you can create an EventHandler through the constructor, and then call invoke, rather than the preferred way of calling the create static method on EventHandler.

Ideas, thoughts?


  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!