6 Replies Latest reply: Dec 21, 2010 8:47 AM by 801416 RSS

    How to identify certain action from multiple sub-panels...

    801416
      Hello everyone,
      I'm new to Swing... and I desperately need help...
      I have ‘n’ numbers of JPanel. And each panel contains certain number of sub-panels. Those sub-panels have actionlisteners. How can I identify which sub-panel fire an action?
      For example –
      Panel_1 => sub_1, sub_2, sub_3
      Panel_2 => sub_1, sub_2, sub_3
      Panel_n => sub_1, sub_2, sub_3
      Note that ‘n’ is unknown and main panels will be created dynamically. Now, if I attach actionListener with all of those sub_panels, how would I be able to figure out which sub_panel fires that action and thatsub-panel belongs to which main panel? In other words, if, sub_2 fires an action, how can I figure out that sub_2 belongs to which main panel?
      Please help me.