javaswing写简单的Helloworld界面


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);

}


}

你可能感兴趣的:(helloworld,javaswing)