package cn.com.test;import java.awt.EventQueue;import javax.swing.JFrame;
import java.awt.Toolkit;public class Test { private JFrame frame; /**
 * Launch the application.
 */
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Test window = new Test();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
} /**
 * Create the application.
 */
public Test() {
initialize();
} /**
 * Initialize the contents of the frame.
 */
private void initialize() {
frame = new JFrame();
frame.setIconImage(Toolkit.getDefaultToolkit().getImage(Test.class.getResource("/cn/com/test/myIcon.JPG")));
frame.setBounds(100, 100, 450, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}}