• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

WindowListener

 
Ranch Hand
Posts: 582
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
What are differencess between mehtod windowClosed(WindowEvent w) and windowClosing(WindowEvent w)?
thanks
daniel
 
Gold Digger
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the API:
void windowClosed(WindowEvent e)
Invoked when a window HAS BEEN CLOSED as the result of calling dispose on the window.
void windowClosing(WindowEvent e)
Invoked when the user ATTEMPTS TO CLOSE the window from the window's system menu.
windowClosed is invoked when the window IS closed and windowClosing is invoked when the user invoked a method that may close a Window (dispose for instance)
HIH

------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! Valentin,
Please, clarify the following line from your post reply;
" windowClosed is invoked when the window IS closed and windowClosing is invoked when the user invoked a method that may close a Window (dispose for instance)"
Like if I have method in which which checks certain conditions if true it closes certain window. So as soon as that method is called the windowClosing will be invoked (which I doubt is the case). To me it is just the timming of the events one is thrown before closing and other is after closing.
Please correct me if wrong.
Thanx in adavance.
Jennifer.
 
Sheriff
Posts: 9099
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
windowClosing() is invoked when the user clicks on the "x" in the top right corner of the Frame or chooses Exit from the File menu.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!