Hallo!
Habe ein Frame und den WindowListener implementiert.
Ich habe den Listener auch angemeldet mit addWindowListener(this);.
Nun habe ich das Problem das er das Frame schließt oder ausblendet obwohl der Status =1 ist.
Also wenn man auf Nein klickt.Und im TaskManager ist das Frame auch noch.
Was kann das sein?
MfG Ronn
Habe ein Frame und den WindowListener implementiert.
Ich habe den Listener auch angemeldet mit addWindowListener(this);.
Code:
//Window Listener---------------------------------------------
public void windowOpened(WindowEvent arg0) {}
public void windowClosing(WindowEvent arg0)
{
if(counter > 0)
{
int status = JOptionPane.showConfirmDialog(this,"Dienst beenden?","Frage ???",JOptionPane.YES_NO_OPTION);
System.out.println(status);
if(status == 0)
{
try
{
server.close();
System.exit(0);
}
catch(IOException fehler)
{
System.out.println(fehler);
}
}
}
if(counter == 0)
{
try
{
server.close();
System.exit(0);
}
catch(IOException fehler){}
}
}
public void windowClosed(WindowEvent arg0) {}
public void windowIconified(WindowEvent arg0) {}
public void windowDeiconified(WindowEvent arg0) {}
public void windowActivated(WindowEvent arg0) {}
public void windowDeactivated(WindowEvent arg0) {}
//------------------------------------------------------------
Nun habe ich das Problem das er das Frame schließt oder ausblendet obwohl der Status =1 ist.
Also wenn man auf Nein klickt.Und im TaskManager ist das Frame auch noch.
Was kann das sein?
MfG Ronn