groovy关闭JFrame窗口的方式与用户单击xclose窗口按钮的方式相同

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了groovy关闭JFrame窗口的方式与用户单击xclose窗口按钮的方式相同相关的知识,希望对你有一定的参考价值。

close a JFrame window the same way as when the user clicks on the X close window button
  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. }

以上是关于groovy关闭JFrame窗口的方式与用户单击xclose窗口按钮的方式相同的主要内容,如果未能解决你的问题,请参考以下文章