Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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 Java 8 in Action this week in the Java 8 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dispose
 
Similar Threads
Two Dimensional Array
Titlebar not showing up during swing printing
Window Size
Displaying Splash Screen in NetBeans
Cannot Resolve Symbol;set PreferredSize