Forums Register Login

jdialog closing event.

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
Did you attach the window listener to your class?
+Pie Number of slices to send: Send
did you mean public class myclass implements WindowListener, of course i did it.
+Pie Number of slices to send: Send
It isn't really time consuming to post the small part of code so that people can really help you over hear.
+Pie Number of slices to send: Send
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");
}
}
+Pie Number of slices to send: Send
OK OK i find it, i forget to add the listener, so this.addWindowListener(this) work perfectly .
thank you.
Gregg Bolinger u'r right.
Live ordinary life in an extraordinary way. Details embedded in this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2947 times.
Similar Threads
How do I print in Color!
setting bg in jDialog
Changing border color in JOptionPane
Regarding JDialog
how to change background color of JDialog
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 23:33:33.