JDK 5.0 Swing - JButton Duplicated Events

I have JPanel that implements Action Listener, then a few JButtons that receive an action listerner to (this). I noticed that evertime any button is clicked, the action associated to the button is repeated twice...

publicclass GenerateFileViewextends JPanelimplements ActionListener{

...

btnGenerate.addActionListener(this);

...

publicvoid actionPerformed(ActionEvent evt){

Object eventSource = evt.getSource();

if (eventSource.equals(cmbWorkOrder)){

...

}elseif (eventSource == btnGenerate){

if (this.validateFields()){

this.generateFile();

}

}

}

}

In this case the method of generateFile is invoked twice and as a result, my output file is generated the first time, and then is overwritten with a second write. Also the method validateFileds() displays dialogs for each invalid fields, and in that case also the dialogs are displayed twice.

The obvious answer was that I have added the action lister to the button twice, however that is not the case.

Any ideas/help on what I may be missing here ?

Thanks,

-MD.

[1770 byte] By [marcio.debarrosa] at [2007-10-2 12:23:54]
# 1
Are you running this on a XP ?Please try the same on Windows it should work fine.
chauhansandeepa at 2007-7-13 9:15:44 > top of Java-index,Security,Event Handling...
# 2
Are you running this on a XP ?Please try the same on Windows it should work fine.
chauhansandeepa at 2007-7-13 9:15:44 > top of Java-index,Security,Event Handling...
# 3
Yes, I am running on XP... however there is no other windows version around for me to test, also the computer that will be running this will have XP. Any workarounds or reason why XP would cause this problem ?
marcio.debarrosa at 2007-7-13 9:15:44 > top of Java-index,Security,Event Handling...
# 4
I figured out what was the problem...I have a method init() to initialize all the Swing components. This method was being called from inside my constructor and also from inside another metod called drawPanel().
marcio.debarrosa at 2007-7-13 9:15:44 > top of Java-index,Security,Event Handling...