File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes EventHandler class and enabling other Component Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "EventHandler class and enabling other Component" Watch "EventHandler class and enabling other Component" New topic

EventHandler class and enabling other Component

Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

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?



Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: EventHandler class and enabling other Component
It's not a secret anymore!