aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Dispose Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Dispose" Watch "Dispose" New topic
Author

Dispose

Pavan Kumar
Greenhorn

Joined: Jan 13, 2002
Posts: 8
Hi when I try to cose thechild window, it is closing parent window also, can any one give the solution. Here I am giving the code.

Calling program :

SOInProcess jFrame = new SOInProcess();
jFrame.setSize(new Dimension(900,650));
Dimension logDim = jFrame.getSize();

int loginX = logDim.width;
int loginY= logDim.height;

jFrame.setLocation((x-loginX)/2,(y-loginY)/2);
jFrame.setVisible(true);


Called Program :


private void exitForm(java.awt.event.WindowEvent evt){
dispose();
// setVisible(false); //
}


pavan kuamr
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
We want to call dispose on each child window and to exit when the main, parent window is closed.
 
Don't get me started about those stupid light bulbs.
 
subject: Dispose