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

📄 sixthwindow.java

📁 《A first book of java》by Gary J.Bronson 北大出版社
💻 JAVA
字号:
import javax.swing.*;
import java.awt.event.*;
public class SixthWindow extends JFrame
{
  private JFrame mainFrame;

  public SixthWindow() // a constructor
  {
    mainFrame = new JFrame("Sixth GUI Window");

   
    mainFrame.setSize(300,150);
    mainFrame.show();

      // create and register the handler in one statement
      // using an anonymous inner class
    mainFrame.addWindowListener(new WindowAdapter()
    {   // anonymous class
      public void windowClosing(WindowEvent e) {System.exit(0);}
    });
  }  

  public static void main(String args[])
  {
    new SixthWindow(); 
  }
    
}  // end of GUI class

⌨️ 快捷键说明

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