groovy close a JFrame window the same way as when the user clicks on the X close window button


/ Published in: Groovy
Save to your folder(s)

close a JFrame window the same way as when the user clicks on the X close window button


Copy this code and paste it in your HTML
  1. def closeWindow( aWindow ) {
  2. // e.g. close a JFrame window the same way as when the user clicks on the X close window button.
  3. java.awt.event.WindowEvent wev = new java.awt.event.WindowEvent(aWindow, java.awt.event.WindowEvent.WINDOW_CLOSING);
  4. java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(wev);
  5. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.