Subject: Modeless dialog
From: Alan Bomberger <email@hidden>
Date: Wed, 4 Jul 2007 12:33:13 -0700
This question may reveal a complete misunderstanding of
Java programming.
In the actionPerformed() method of a "JMenu implements ActionListener"
the code calls a function that computes (it writes a file) for
a lengthy time. The code puts up a modeless dialog with a cancel
button and polls the dialog object to see if the cancel button
has been pressed.
The cancel button is never selected (unless I cause an exception
and kill the thread writing the file).
I suspect that the code is running on the action thread and
therefore there is no thread to process the button event.
Is there a simple "fix" or am I doing something horribly
wrong. Too much Windows and OS 9 programming under the belt
so I tend to do things "the old way". After all I believe
that you can write Fortran programs in any language.
Thanks for your patience.