Click to See Complete Forum and Search --> : WindowClosing: close the frame or the dialog???


urindar
04-07-2004, 08:18 AM
Hi there!!!

I have a small application using frames and dialogs and I have a problem with the windowClosing() method.

I have added WindowListeners to the frame and the dialog box, but my problem is that when I try to close the dialog, I just want to close the dialog, not the entire application... and inside the windowClosing method I cant find a way to tell whichone is trying to be closed, the frame or the window...


:confused:
private Dialog d = new Dialog(f, "my dialog", true);
private Frame f = new Frame("my frame");
.
.
.
public void windowClosing(WindowEvent e){
f.dispose();
}

At this time I just kill the frame... =(

Pradeep SV
05-03-2004, 06:56 AM
Hi
Dipose the object which u requrie Y ur disposing the whole frame itself

public void windowClosing(WindowEvent e){
d.dispose();
}

Try with this

Pradeep SV
Manvish eTech (P) Ltd.
http://www.manvish.com

Pradeep SV
05-03-2004, 07:12 AM
Hi
Dipose the object which u requrie Y ur disposing the whole frame itself

public void windowClosing(WindowEvent e){
d.dispose();
}

Try with this

Pradeep SV

Pradeep SV
05-03-2004, 07:59 AM
Hi
Dipose the object which u requrie Y ur disposing the whole frame itself

public void windowClosing(WindowEvent e){
d.dispose();
}

Try with this

Pradeep SV