• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EventHandler class and enabling other Component

 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
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?

Thanks

Mark
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic