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

📄 firstswingdemo.java

📁 此文件能系统的介绍Java初级知识
💻 JAVA
字号:
package swing.first;

import javax.swing.JFrame;
import javax.swing.JLabel;

import swing.WindowDestroyer;






/**
 A simple demonstration of a window constructed with Swing.
*/
public class FirstSwingDemo
{
    public static final int WIDTH = 300;
    public static final int HEIGHT = 200;

    public static void main(String[] args)
    {
        JFrame myWindow = new JFrame( );
        myWindow.setSize(WIDTH, HEIGHT);
        JLabel myLabel =
                   new JLabel("Please don't click that button!");
        myWindow.getContentPane( ).add(myLabel);

        WindowDestroyer myListener = new WindowDestroyer( );
        myWindow.addWindowListener(myListener);

        myWindow.setVisible(true);
    }
}

⌨️ 快捷键说明

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