facebook

Consolidate checkbox actionPerformed methods?

  1. MyEclipse Archived
  2.  > 
  3. Matisse/Swing UI Development
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #274154 Reply

    ernestz
    Member

    Using ME 5.5 and I have a simple form with several JCheckBox objects. I want to perform some action (enable/disable other controls) based on some of these JCheckBox objects being checked or unchecked.

    Using the Swing/Matisse perspective, I can add actionPerformed() methods for each checkbox, resulting in multiple …actionPerformed() methods.

    I want a single actionPerformed() for all of these buttons, so, using the Properties/Events window, I try to change the actionPerformed event to my custom method. But, it appears that only one checkbox can be associated with my custom handler. I try to change the handler for the other checkboxes, but they always revert back to the ME generated method name.

    Is it not possible to change the actionPerformed() handler for multiple checkboxes to a single handler? I can manually edit the init() method, but if I modify the form in any way, ME regenerates the init() method, overriding my changes.

    #274289 Reply

    Loyal Water
    Member

    Is it not possible to change the actionPerformed() handler for multiple checkboxes to a single handler?

    This is not possible.

    #274310 Reply

    Riyad Kalla
    Member

    ernestz,
    If you didn’t mind a bit more leg work, you could double-delegate… like all your action listeners all call your *reall* implementation… that’s one option.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Consolidate checkbox actionPerformed methods?

You must be logged in to post in the forum log in