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

📄 frameuseinherit.java

📁 java课件
💻 JAVA
字号:
/*
 * FrameUseInherit.java
 *
 * Created on 2007年11月5日, 上午9:50
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

/**
 *
 * @author Administrator
 */
import javax.swing.JFrame;
public class FrameUseInherit extends JFrame{
    
    /** 无参构造方法 */
    public FrameUseInherit() {
        this("A Frame Demo");
    }
    
    /** 参数为窗口标题的构造方法 */
    public FrameUseInherit(String title){
        super(title);
        this.setSize(400,300);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setVisible(true);
    }
    
    /** main方法 */
    public static void main(String[] args){
        new FrameUseInherit();
        new FrameUseInherit("使用继承创建的窗口");
    }
}

⌨️ 快捷键说明

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