JButton Toolbar dispatches an actionPerformed event twice
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Monday, April 18, 2005 12:59 PM

Hi!! I'm developing a Java swing application, I have a main class into which I create Dialogs. Also I have a class named DialogoPropiedades extended from JDialog in order to create Dialogs mentioned. Into this class I added JTabbedPane, every Tab is a Class extended from JPanel named Controladora, but I extends this class in other named PanelGeneral, because Controladora executes global statements like create componentes including a JToolBar with Jbuttons. PanelGeneral, according to the necessity, executes specialized code. When I create a DialogoPropiedades (using new) for first time, Buttons event dispatch an actionPerformed on panel 'PanelGeneral.actionPerformed(...)' and into this method I execute super.actionPerformed(...) in Controladora class, and everything   More>>

Hi!! I'm developing a Java swing application, I have a main class into which I create Dialogs. Also I have a class named DialogoPropiedades extended from JDialog in order to create Dialogs mentioned. Into this class I added JTabbedPane, every Tab is a Class extended from JPanel named Controladora, but I extends this class in other named PanelGeneral, because Controladora executes global statements like create componentes including a JToolBar with Jbuttons. PanelGeneral, according to the necessity, executes specialized code. When I create a DialogoPropiedades (using new) for first time, Buttons event dispatch an actionPerformed on panel 'PanelGeneral.actionPerformed(...)' and into this method I execute super.actionPerformed(...) in Controladora class, and everything is OK. When I close JDialog and open it again, Buttons on toolbar dispatch an actionPerformed event when is pressed and then dispatch an actionPerformed event again for same button. I don't know why is happening this. Could be JDialog or components are not destroyed from memory? or Inheritance makes events happens twice?

here a little bit diagram composite


main class
|
+-->DialogoPropiedades class(JDialog)
|
|
+-> JTabbedPane
|
|
+-> Tab1: PanelGeneral class(Controladora)
|
+-> Tab2: PanelGeneral class(Controladora)
|
|
v
extends JPanel


thanks

   <<Less
About | Sitemap | Contact