java的GUI编程

目前有三种创建模版产生应用窗体:

第一种:

public class MenuDemo implements ActionListener{
//你的组件(成员变量)
    public MenuDemo(){//构造方法
             JFrame frame=new JFrame("菜单窗体");
              frame.setSize(300,300);
            frame.setLocation(300,200);
            frame.setResizable(false);
            frame.setVisible(true);

第二种:

public class Demodemo extends JFrame{
    //你的组件
    public Demodemo(){
        this.setTitle("我的窗体");
        this.setSize(300, 300);
        this.setLocation(300, 200);
        this.setResizable(false);
        this.setVisible(true);
    }

第三种:

主要组件有:文本域(TextArea),文本框(TextField),复选框(checkbox),按钮(botton),菜单栏(Menubar),菜单项(MenuItem),菜单(Menu),文件打开对话框、文件保存对话框(FileDialog),对话框(Dialog),滚动条jscrollpane), 

原文地址:https://www.cnblogs.com/liujie037/p/3982863.html