实验十三

package 实验十三;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
@SuppressWarnings("serial")
class Menul extends JFrame{
    JMenuBar jmb;
    JMenu x1,x2,x3,x4,x5,x6;
    JMenuItem t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17;
public Menul() {
    jmb=new JMenuBar();
    x1=new JMenu("开始");
    x2=new JMenu("你的毕业学校");
    x3=new JMenu("所学专业");
    x4=new JMenu("想从事的职业");
    x5=new JMenu("为什么想从事这份工作");
    x6=new JMenu("希望去哪个地方工作");
    t1=new JMenuItem("青海师范大学"); 
    t2=new JMenuItem("青海大学"); 
    t3=new JMenuItem("青海民族大学"); 
    t4=new JMenuItem("网络工程");
    t5=new JMenuItem("土木工程"); 
    t6=new JMenuItem("水利工程"); 
    t7=new JMenuItem("生物学");
    t8=new JMenuItem("保存"); 
    t9=new JMenuItem("编辑"); 
    t10=new JMenuItem("复制"); 
    t11=new JMenuItem("粘贴"); 
    t12=new JMenu("建筑师");
    t13=new JMenu("软件设计师");
    t14=new JMenu("老师");
    t16=new JMenu("南方");
    t17=new JMenu("北方");
     x1.add(t8);
     x1.add(t9);
     x1.add(t10);
     x1.add(t11);
     x2.add(t1);
     x2.add(t2);
     x2.add(t3);
     x3.add(t4);
     x3.add(t5);
     x3.add(t6);
     x3.add(t7);
     x4.add(t12);
     x4.add(t13);
     x4.add(t14);
     x4.add(x5);
     x6.add(t15);
     x6.add(t16);
     x6.add(t17);  
     jmb.add(x1);
     jmb.add(x2);
     jmb.add(x3);
     jmb.add(x4);
     jmb.add(x6);
     this.setJMenuBar(jmb);
     this.setBounds(80, 80, 500, 400);
     this.setVisible(true);
     this.setDefaultCloseOperation(EXIT_ON_CLOSE);    
}
public static void main(String[] args) {
        new Menul();
        
}
}

转载于:https://www.cnblogs.com/hhyy/p/11073932.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值