java.awt.event.WindowListener类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(88)

本文整理了Java中java.awt.event.WindowListener类的一些代码示例,展示了WindowListener类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WindowListener类的具体详情如下:
包路径:java.awt.event.WindowListener
类名称:WindowListener

WindowListener介绍

[英]The listener interface for receiving window events. The class that is interested in processing a window event either implements this interface (and all the methods it contains) or extends the abstract WindowAdapter class (overriding only the methods of interest). The listener object created from that class is then registered with a Window using the window's addWindowListener method. When the window's status changes by virtue of being opened, closed, activated or deactivated, iconified or deiconified, the relevant method in the listener object is invoked, and the WindowEvent is passed to it.
[中]用于接收窗口事件的侦听器接口。对处理窗口事件感兴趣的类要么实现此接口(及其包含的所有方法),要么扩展抽象WindowAdapter类(仅覆盖感兴趣的方法)。然后使用窗口的addWindowListener方法向窗口注册从该类创建的侦听器对象。当窗口的状态因打开、关闭、激活或停用、图标化或非图标化而改变时,将调用侦听器对象中的相关方法,并将WindowEvent传递给它。

代码示例

代码示例来源:origin: geotools/geotools

/** Invoked when an internal frame has been closed. */
public void internalFrameClosed(InternalFrameEvent event) {
  listener.windowClosed(null);
}

代码示例来源:origin: geotools/geotools

/**
 * Invoked when an internal frame is in the process of being closed. The close operation can be
 * overridden at this point.
 */
public void internalFrameClosing(InternalFrameEvent event) {
  listener.windowClosing(null);
}

代码示例来源:origin: geotools/geotools

/** Invoked when a internal frame has been opened. */
public void internalFrameOpened(InternalFrameEvent event) {
  listener.windowOpened(null);
}

代码示例来源:origin: stackoverflow.com

e -> System.out.println("Window closed"));
w.windowActivated(null);
w.windowClosed(null);

代码示例来源:origin: geotools/geotools

/** Invoked when an internal frame is activated. */
public void internalFrameActivated(InternalFrameEvent event) {
  listener.windowActivated(null);
}

代码示例来源:origin: geotools/geotools

/** Invoked when an internal frame is de-activated. */
  public void internalFrameDeactivated(InternalFrameEvent event) {
    listener.windowDeactivated(null);
  }
}

代码示例来源:origin: geotools/geotools

/** Invoked when an internal frame is iconified. */
public void internalFrameIconified(InternalFrameEvent event) {
  listener.windowIconified(null);
}

代码示例来源:origin: geotools/geotools

/** Invoked when an internal frame is de-iconified. */
public void internalFrameDeiconified(InternalFrameEvent event) {
  listener.windowDeiconified(null);
}

代码示例来源:origin: org.geotools/gt-metadata

/**
 * Invoked when an internal frame is activated.
 */
public void internalFrameActivated(InternalFrameEvent event) {
  listener.windowActivated(null);
}

代码示例来源:origin: org.geotools/gt2-metadata

/**
   * Invoked when an internal frame is de-activated.
   */
  public void internalFrameDeactivated(InternalFrameEvent event) {
    listener.windowDeactivated(null);
  }
}

代码示例来源:origin: org.geotools/gt2-metadata

/**
 * Invoked when an internal frame is iconified.
 */
public void internalFrameIconified(InternalFrameEvent event) {
  listener.windowIconified(null);
}

代码示例来源:origin: org.geotools/gt2-metadata

/**
 * Invoked when an internal frame is de-iconified.
 */
public void internalFrameDeiconified(InternalFrameEvent event) {
  listener.windowDeiconified(null);
}

代码示例来源:origin: org.geotools/gt2-metadata

/**
 * Invoked when an internal frame has been closed.
 */
public void internalFrameClosed(InternalFrameEvent event) {
  listener.windowClosed(null);
}

代码示例来源:origin: org.geotools/gt-metadata

/**
 * Invoked when an internal frame is in the process of being closed.
 * The close operation can be overridden at this point.
 */
public void internalFrameClosing(InternalFrameEvent event) {
  listener.windowClosing(null);
}

代码示例来源:origin: org.geotools/gt-metadata

/**
 * Invoked when a internal frame has been opened.
 */
public void internalFrameOpened(InternalFrameEvent event) {
  listener.windowOpened(null);
}

代码示例来源:origin: org.geotools/gt2-metadata

/**
 * Invoked when an internal frame is activated.
 */
public void internalFrameActivated(InternalFrameEvent event) {
  listener.windowActivated(null);
}

代码示例来源:origin: org.geotools/gt-metadata

/**
   * Invoked when an internal frame is de-activated.
   */
  public void internalFrameDeactivated(InternalFrameEvent event) {
    listener.windowDeactivated(null);
  }
}

代码示例来源:origin: org.geotools/gt-metadata

/**
 * Invoked when an internal frame is iconified.
 */
public void internalFrameIconified(InternalFrameEvent event) {
  listener.windowIconified(null);
}

代码示例来源:origin: org.geotools/gt-metadata

/**
 * Invoked when an internal frame is de-iconified.
 */
public void internalFrameDeiconified(InternalFrameEvent event) {
  listener.windowDeiconified(null);
}

代码示例来源:origin: org.geotools/gt-metadata

/**
 * Invoked when an internal frame has been closed.
 */
public void internalFrameClosed(InternalFrameEvent event) {
  listener.windowClosed(null);
}

相关文章