Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
|
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 15th, 2011, 02:28 PM
Registered User
 
Join Date: Apr 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Help me please to close Dialog window.

This code below doesn`t works. I dont now why. Thanks for help.

class Options extends Dialog{
Options(Frame fr){
super(fr,true);
setBounds(0,0,100,100);
setVisible(true);
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
dispose();
}});
}
 
Old February 14th, 2012, 07:38 AM
Registered User
 
Join Date: Feb 2012
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post
Default Reply

Code:
class Options extends Dialog{
Options(Frame fr){
super(fr,false);
setBounds(0,0,100,100);
setVisible(true);
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
dispose();
}});
}
}
Code:
class Options extends Dialog{
Options(Frame fr){
super(fr,false);
setBounds(0,0,100,100);
setVisible(true);
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}});
}
}
Code:
class Options extends Dialog{
Options(Frame fr){
super(fr,false);
setBounds(0,0,100,100);
setVisible(true);
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
setVisible(true);
}});
}
}





Similar Threads
Thread Thread Starter Forum Replies Last Post
Communication between a parent window and a modal dialog window swizz182g Javascript 0 August 27th, 2009 04:41 PM
window.close() failing to...well...close! mheathcote Javascript How-To 2 October 31st, 2005 03:02 PM
Modal dialog - Disable Close button itHighway Javascript How-To 1 July 31st, 2005 01:58 AM
Close Parent window on opening child window pkdev Javascript How-To 8 April 11th, 2004 12:06 PM
How do i close pop-up window?: window.close () Burton HTML Code Clinic 2 September 8th, 2003 05:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.