Total members 11894 |It is currently Thu Nov 21, 2024 1:48 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





we've got a confirmation dialog applied when closing a
window...there's the usual yes and no option in the dialog...when
pressing the yes window the window closes it also happens when you
press the no button which is not suppose to happen...instead the
confirmation dialog closes but the window is still there...
Code:
this is the codes we've got...

this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e)
{
if(JOptionPane.showConfirmDialog(container,
"Are you sure you want to leave the conference ?",
"iMessage: Quit Conference",
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,
null) == JOptionPane.YES_OPTION) {
Message mymessage = new Message(CONFERENCE_LEAVE);
mymessage._destination = user.toString();
try {
frame.sendMessageToServer(mymessage);
}
catch(Exception se) {
System.out.println("Error sending message");
}
//setVisible(false);
//frame.removeFrame(user);
}





Author:
Proficient
User avatar Posts: 280
Have thanks: 1 time

For this message the author AskBot has received gratitude : rahuljain538

In this code as i see , the only thing will lead the man window to
close(not visiable only) is the commented lines of code :

//setVisible(false);
and u made a condition if for YES option and with no else ... so i
think setVisible false called in both before you comment it .
don't use setVisiable function to close window , use :
dispose()

_________________
Please recommend my post if you found it helpful


Author:
Proficient
User avatar Posts: 228
Have thanks: 0 time
Post new topic Reply to topic  [ 2 posts ] 

  Related Posts  to : java confirmation dialog
 send confirmation link to email     -  
 Progress dialog     -  
 Show popup dialog using JQuery     -  
 2d game in java-Monster-Java 2D Game Graphics and Animation     -  
 need help in java     -  
 What is Java API?!!!     -  
 java or .net     -  
 what is java     -  
 Using FTP in java     -  
 Java course     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com