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

📄 winframe.java

📁 Java邮箱
💻 JAVA
字号:
package Email.awt;

import java.awt.*;
import Email.awt.event.*;

public class WinFrame extends Frame {
  public WinFrame(String title) {
    super(title);
    addWindowListener( new WindowDisposeAdapter() );
  }

  public WinFrame() {
    addWindowListener( new WindowDisposeAdapter() );
  }

  public WinFrame(String title, Panel p) {
    super(title);
    addWindowListener( new WindowDisposeAdapter() );
    add("Center",p);
    pack();
  }

  public WinFrame(String title, Throwable t) {
    this( title,new WinPanel(t) );
    setVisible(true);
  }
  
  public WinFrame(Frame parent, String title, Throwable t) {
    this( title,new WinPanel(t) );
    setVisible(true);
  }

  public static void dispose(Component[] c) {
    for (int i = 0; i < c.length; i++)
      if (c[i] instanceof WindowDisposeListener)
        ( (WindowDisposeListener)c[i] ).dispose();
      else if (c[i] instanceof Container)
        dispose( ( (Container)c[i]).getComponents() );
  }

  public void dispose() {
    dispose( getComponents() );
    super.dispose();
  }

  public static void apply(Component[] c) {
    for (int i = 0; i < c.length; i++)
      if (c[i] instanceof WindowApplyListener)
        ( (WindowApplyListener)c[i] ).apply();
      else if (c[i] instanceof Container)
        apply( ( (Container)c[i] ).getComponents() );
  }

  public void apply() {
    apply( getComponents() );
  }

  public WinFrame appMainWindow() {
    addWindowListener( new AppMainWindow() );
    return this;
  }
 
}

⌨️ 快捷键说明

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