e565. 关闭的时候隐藏窗口
Posted borter
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了e565. 关闭的时候隐藏窗口相关的知识,希望对你有一定的参考价值。
By default, when the close button on a frame is clicked, nothing happens. This example shows how to make the action hide the frame. One reason for hiding rather than disposing a frame would be to reuse the frame later.
// Create a frame
Frame frame = new Frame();
// Add a listener for the close event
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent evt) {
Frame frame = (Frame)evt.getSource();
// Hide the frame
frame.setVisible(false);
// If the frame is no longer needed, call dispose
frame.dispose();
}
});
Related Examples |
以上是关于e565. 关闭的时候隐藏窗口的主要内容,如果未能解决你的问题,请参考以下文章
android 如何实现点击activity窗口以外的地方关闭或隐藏窗口?