NetBeans下载安装(初学者可以选择 All类型 版本下载)
下载链接:
https://netbeans.org/downloads/index.html
打开应用NetBeans,新建java应用程序,在项目中新建JFrame窗体
JavaApplication2代码:
import java.awt.EventQueue;
import javax.swing.JFrame;
/**
*
* @author wxx
*/
public class JavaApplication2 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
EventQueue.invokeLater(new Runnable()
{
public void run()
{
HelloWorld frame=new HelloWorld();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
});
}
}
HelloWorld为可视化编程界面(类似.Net框架)
控件的触发事件(自动生成相应函数,类似.Net环境)
注意有每标签窗口有"源(S)"和"设计(D)"两子窗口,来回切换