>>>>> Dimitris Vyzovitis writes:
Dimitris> [1 <text/plain; us-ascii (7bit)>]
Dimitris> Juergen Kreileder wrote:
>> >>>>> Dimitris Vyzovitis writes:
>>
Dimitris> Hi everyone,
Dimitris> It appears there is a nasty bug in a modal dialog's
Dimitris> construction process. If I subclass a modal dialog that
Dimitris> appears in its constructor (ie the constructor ends with
Dimitris> the typical pack(); show(); setResizable( false ); ),
Dimitris> the subclass constructor doesn't get called unless the
Dimitris> dialog is disposed.
>>
>> This behavior is correct. show() on a modal dialog will block until
>> the dialog is hidden by calling hide() or dispose().
>>
>> By the way: This means that your setResiable(false) will have no
>> effect because it won't get executed until the dialog is hidden.
Dimitris> And the situation isn't quite as you describe, since the
Dimitris> dialog that appears (before the subclass constructor is
Dimitris> actually executed) is not resizable. Furthermore, how
Dimitris> do you explain the fact that if I use the native
Dimitris> threads, the subclass constructor is called?
I see no difference, see below.
Dimitris> What happens is that the message only appears after the
Dimitris> dialog is disposed!!!! This DOESN'T happen in windows,
Dimitris> jdk1.1.7a (still there ;-} )
>>
>> If show() doesn't block immediately on windows then it's a bug in
>> windows JDK.
Dimitris> A bug in every possible jdk implementation under windows
Dimitris> (netscape, sun, microsoft)? Don't think so... Just
Dimitris> don't forget that windows implementations use native
Dimitris> thraeds (and it behaves as expected with linuxthreads as
Dimitris> well)
I wrote a short program and tested it with 1.1.7, 1.2 (both with
green and native threads) on Solaris and with 1.1.7 (green threads
and native threads) and 1.2 native threads (not available yet) on Linux:
All show the same behavior -- the execution stops after show().
Where does the execution stop on windows? After the finishing the
execution of the topmost constructor?
Could you please send me your code, so I can take a closer look
at this?
Note that we are talking about modal dialogs but your posted example
creates a *non*-modal dialog:
> public NoiseWizard( Component master, NoiseBuilder builder ) throws
> AWTException
> {
> super( components.applet.AppletUtilities.getTopLevelParent( master ),
> "Noise Builder Wizard", false, false );
*****
Juergen
--
Juergen Kreileder, Universitaet Dortmund, Lehrstuhl Informatik V
Baroper Strasse 301, D-44221 Dortmund, Germany
Phone: ++49 231/755-5806, Fax: ++49 231/755-5802