Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dispose

 
Pavan Kumar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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); //
}
 
Craig Wood
Ranch Hand
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We want to call dispose on each child window and to exit when the main, parent window is closed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic