• Post Reply Bookmark Topic Watch Topic
  • New Topic

jdialog closing event.

 
samantha clarkson
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, i have a class which extends from jdialog it implements WindowListener and i've implemented all methods of that interface, just adding System.out.println("something") to see the events catched, but nothing happened .
any idea.
thanks.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you attach the window listener to your class?
 
samantha clarkson
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did you mean public class myclass implements WindowListener, of course i did it.
 
adeeb alexander
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It isn't really time consuming to post the small part of code so that people can really help you over hear.
 
samantha clarkson
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that's my code :

public class FilterDialog extends JDialog implements ActionListener, WindowListener {

public FilterDialog() {
//of course there are jpanels jbuttons and other components
//the jdialog appear correctly and close correctly but nothing to display in the console
}

public void actionPerformed(ActionEvent ae) {}

public void windowActivated(WindowEvent e) {
// TODO Auto-generated method stub
System.out.println("windowActivated");

}


public void windowClosed(WindowEvent e) {
// TODO Auto-generated method stub
System.out.println("windowClosed");
}


public void windowClosing(WindowEvent e) {
// TODO Auto-generated method stub
System.out.println("windowClosing");
}


public void windowDeactivated(WindowEvent e) {
// TODO Auto-generated method stub
System.out.println("windowDeactivated");
}


public void windowDeiconified(WindowEvent e) {
// TODO Auto-generated method stub
System.out.println("windowDeiconified");
}


public void windowIconified(WindowEvent e) {
// TODO Auto-generated method stub
System.out.println("windowIconified");
}


public void windowOpened(WindowEvent e) {
// TODO Auto-generated method stub
System.out.println("windowOpened");
}
}
 
samantha clarkson
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK OK i find it, i forget to add the listener, so this.addWindowListener(this) work perfectly .
thank you.
Gregg Bolinger u'r right.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!