Article View: borland.public.jbuilder.java.language
Article #50Jbuilder firing events twice... why?
From: Kiran Deshpande
Date: Sun, 17 Jan 1999 00:00
Date: Sun, 17 Jan 1999 00:00
47 lines
2579 bytes
2579 bytes
Hi,
I am running across problems because JBuilder is firing events
twice. It basically executes the code fragment twice. Here is an
example scenario:
I have two dialog boxes,
Dialog1 has : a grid control, a button 'Modify', and the grid is
assigned a dataset.
Dialog2 has: jdbTextFields for modifying the data in the dataset, and
buttons to save, cancel and close.
First I get a list of rows into the dataset and set it to 'Dialog1'.
Now when I press the 'Modify' button on this dialog, it disposes
'Dialog1' and I assign the dataset to 'Dialog2' so that the user can
modify the data, and I show 'Dialog2'. After this when the user clicks
on 'Close' on 'Dialog2' I dispose 'Dialog2'. When I debugged this code
fragment, I noticed that the program goes into the actionPreformed
event of 'Close' button of 'Dialog2' twice and then again into the
actionPerformed event of 'Modify' button on 'Dialog1' thus displaying
the 'Dialog2' again.
the sequence of events are:
1. modify_actionPerformed in 'Dialog1' (user clicks no the 'Modify'
button)
- disposes 'Dialog1' and shows 'Dialog2'
2. this shows 'Dialog2'
3. close_actionPerformed in 'Dialog2' (user Clicks on the 'Close'
button)
- disposes 'Dialog2'
4. again close_actionPerformed in 'Dialog2' (why?)
5. goes again into modify_actionPerformed in 'Dialog1' (why should it do
this?)
6. shows 'Dialog2' again
7. close_actionPerformed in 'Dialog2' (user Clicks on the 'Close'
button)
8. again close_actionPreformed in 'Dialog2'
9. finally 'Dialog2' is not there.
Why does JBuilder fire the events twice. This is so weird and I dont
know what to do to fix this stupid problem.
How do I fix this problem. has anyone else come across this problem.
All your help will be greatly appretiated.
Thanks & regards
Kiran
Technical Details
Message-ID:
<36A2221E.7164C865@incentric.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1073da,93398afba4987f59,start X-Google-Attributes: gid1073da,public X-Google-Thread: ff5c5,93398afba4987f59,start X-Google-Attributes: gidff5c5,public X-Google-Thread: f74b3,93398afba4987f59,start X-Google-Attributes: gidf74b3,public From: Kiran Deshpande <kdeshpande@incentric.com> Subject: Jbuilder firing events twice... why? Date: 1999/01/17 Message-ID: <36A2221E.7164C865@incentric.com> X-Deja-AN: 433692878 Content-Transfer-Encoding: 7bit Organization: Another Netscape Collabra Server User Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language,borland.public.jbuilder.database,borland.public.jbuilder.debugger