Hi everyone,
It appears there is a nasty bug in a modal dialog's construction
process.
If I subclass a modal dialog that appears in its constructor (ie the
constructor ends with the typical pack(); show(); setResizable( false );
),
the subclass constructor doesn't get called unless the dialog is
disposed.
This is an example:
Consider this base class constructor:
class Wizard extends DIalog
{
// ....
public Wizard( java.awt.Frame parent, String title, boolean modal,
boolean resizable )
throws java.awt.AWTException
{
super( parent, modal );
setTitle( title );
_createControls();
addWindowListener( new java.awt.event.WindowAdapter()
{
public void windowClosing( java.awt.event.WindowEvent evt )
{
onCancel();
}
});
pack();
show();
setResizable( resizable );
}
//.....
}
and let the subclass constructor be:
class NoiseWizard extends Wizard
{
// ....
public NoiseWizard( Component master, NoiseBuilder builder ) throws
AWTException
{
super( components.applet.AppletUtilities.getTopLevelParent( master ),
"Noise Builder Wizard", false, false );
builder_ = builder;
System.out.println( "NoiseWizard constructor finished..." );
}
// .....
}
What happens is that the message only appears after the dialog is
disposed!!!!
This DOESN'T happen in windows, jdk1.1.7a (still there ;-} )
It looks like a bug to me, what do you think?
(I know the workariund, have the sub-class handle the appearance, but
shouldn't it better if someone could fix this bug? )
Dimtiris