UI java 源码

来源:百度知道 编辑:UC知道 时间:2024/05/30 03:30:29
谁能提供我个UI的JAVA源码。。。功能比较简单就行。。。能用记事本打开的.java文件 谢谢

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

public class SimFrame extends JFrame {

public SimFrame() {
this.setTitle("Sample JFrame Test");
this.setBounds(400, 250,400, 200);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLayout(null);
JLabel lab = new JLabel("Hello, world!");
lab.setBounds(100, 50, 100, 100);
this.add(lab);
this.setVisible(true);

}

public static void main(String [] args) {
new SimFrame();
}

}