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

📄 chap11-1.txt

📁 JAVA 学习资源
💻 TXT
字号:
// 程序11-1
import java.awt.*;
import java.applet.Applet;
import javax.swing.*;

public class showJFrame{
    public static void main(String args[ ]){
        showJFrame  obj=new showJFrame( );

        obj.testJFrame( );
    }

    public void testJFrame( ){
        JFrame frame=new subJFrame("TestJFrame");	// 生成一个带标题的框架
        Container contentPane=frame.getContentPane( );// 取得内容格
        contentPane.setLayout(new FlowLayout( ));       // 设置布局管理器
        contentPane.add(new JButton(" OK "));	// 添加组件
        contentPane.add(new JTextField(10));
        
        frame.setSize(200,100);		// 设置框架显示的页面
        frame.show( );			// 显示框架
    }
}

⌨️ 快捷键说明

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