首页 > 代码库 > java Swing 练习

java Swing 练习

import javax.swing.JFrame; 

public class Swingtest {
    static final int WIDTH = 500;
    static final int HEIGHT = 500;
    public static void main(String[] args){
        JFrame jf = new JFrame("hello,Swinghahahahahah !");
        jf.setSize(WIDTH,HEIGHT);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jf.setVisible(true);
    }
}

运行后出现的是一个提示框,提示框的边框上写着

"hello,Swinghahahahahah !"

java Swing 练习