This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript 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
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.
 
Beware the other head of science - it bites! Nibble on this message:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!