/**
* Creates and registers a {@link WindowListener} to {@code parent} window, which causes
* the {@code child} window to close when the {@code parent} window is closed.
*
* @param parent
* the window whose closing will cause child to close as well.
* @param child
* the window that will be closed when parent is closed.
* @return the created listener
*/
public static WindowListener addCloseCallback( Window parent, Window child )
{
return addCloseCallback(
parent, () -> {
// Dispatch closing event instead of calling dispose() directly,
// so that event listeners are notified.
child.dispatchEvent(
new WindowEvent(
child,
WindowEvent.WINDOW_CLOSING
)
);
}
);
}
SwingUIUtils.java 文件源码
java
阅读 33
收藏 0
点赞 0
评论 0
项目:hiervis
作者:
评论列表
文章目录