import javax.swing.*; |
/** |
* 一个简单的java窗体例子 |
*/ |
public class Test { |
public static void main(String[] args) throws Exception { |
JFrame frame = new JFrame( "Hello World!" ); |
JLabel label = new JLabel( "Hello World!" ); |
frame.add(label); |
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // 设置关闭的事件 |
frame.setSize( 300 , 100 ); // 设置大小 |
frame.setVisible( true ); // 使窗口可视 |
} |
} |
初级程序员
by: 宝二也 发表于:2017-05-19 19:21:49 顶(0) | 踩(0) 回复
66
回复评论