Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Listener not getting message?  RSS feed

 
Geoffrey Falk
Ranch Hand
Posts: 171
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is this listener never getting invoked when I try to close the window?:
public class FrameBug {
public static void main(String[] args) {
java.awt.Frame f = new java.awt.Frame();
f.addWindowListener(new java.awt.event.WindowAdapter() {
public void WindowClosing(java.awt.event.WindowEvent e) {
System.exit(0);
}
});
f.pack();
f.show();
}
}
Thank you!
Geoffrey
 
Vinod Venugopal
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change "WindowClosing" to "windowClosing" in your windowListener method.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!