/**
* Creates and registers a {@link WindowListener} to {@code window}, which executes the callback expression.
*
* @param window
* the window whose closing will cause the callback to be executed.
* @param callback
* the callback to execute when the window closes.
* @return the created listener
*/
public static WindowListener addCloseCallback( Window window, Runnable callback )
{
WindowListener listener = new WindowAdapter() {
@Override
public void windowClosing( WindowEvent e )
{
callback.run();
}
};
window.addWindowListener( listener );
return listener;
}
SwingUIUtils.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:hiervis
作者:
评论列表
文章目录