⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hw16_19.java

📁 JAVA 2面向对象程序设计(习题参考答案9-17).rar
💻 JAVA
字号:
import java.awt.*;
import java.awt.event.*;
public class hw16_19 extends Frame  
{
   static hw16_19 frm=new hw16_19(); 
   static WinLis wlis=new WinLis(); 

   public static void main(String args[])
   { 
      frm.setSize(200,150);
      frm.setTitle("Window Event");
      frm.addWindowListener(wlis); 
      frm.setVisible(true); 
   } 
 
   static class WinLis implements WindowListener
   {
      public void windowClosing(WindowEvent e)
      {
         System.out.println("windowClosing() called");
         System.out.println("Closing window...");
         frm.dispose();   
         System.out.println("window closed..."); 
      }
      public void windowClosed(WindowEvent e) 
      {        
         System.out.println("windowClosed() called");
      } 
      public void windowDeactivated(WindowEvent e) 
      {
         System.out.println("windowDeactivated() called");
      }       
      public void windowActivated(WindowEvent e) 
      {
         System.out.println("windowActivated() called");
      }            
      public void windowDeiconified(WindowEvent e) 
      {
         System.out.println("windowDeiconified() called");
      }         
      public void windowIconified(WindowEvent e)
      {
         System.out.println("windowIconified() called");
      }   
      public void windowOpened(WindowEvent e) 
      {
         System.out.println("windowOpened() called");
      }            
   }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -