javaswing写简单的Helloworld界面

来源:互联网 发布:淘宝衣服商城男装 编辑:程序博客网 时间:2024/05/21 02:48

package test;


import java.awt.*;


import javax.swing.*;


public class Helloworld{


private JFrame frame;


/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Helloworld1 window = new Helloworld1();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}


/**
* Create the application.
*/
public Helloworld1() {
initialize();
}


/**
* Initialize the contents of the frame.
*/
private void initialize() {
frame = new JFrame("Helloworld");
frame.setBounds(100, 100, 450, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);

}


}
0 0