⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 student.java~1~

📁 图形化界面
💻 JAVA~1~
字号:
package studentinformation;import java.awt.* ;import java.awt.Menu;import java.awt.MenuBar;import java.awt.MenuItem;import java.awt.event.*;import java.util.Vector;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2006</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class student{  public static void main(String args[])  {    new FrameOutputThen ();  }}class FrameOutputThen extends Frame      implements ActionListener   { //       Vector NewSetStudent=new Vector(10,1);//定义一个学生信息数据库//     EnterFrame ef;     MenuBar StudentMenu;     Menu files,tools,helps; //    PopupMeue tools;     MenuItem open,newfile,close,save,save_as,sort,delete,change,         insert,main_help;     TextArea ta;    FrameOutputThen()    {      super("菜单");      ta=new TextArea("\t\t欢迎您的使用\n",25,100);      add("Center",ta);      StudentMenu=new MenuBar();     files=new Menu("文件");     open=new MenuItem("打开");     newfile=new MenuItem("新建");     close=new MenuItem("关闭");     save=new MenuItem("保存");     save_as=new MenuItem("另存为");     open.addActionListener(this);     newfile.addActionListener(this);     close.addActionListener(this);     save.addActionListener(this);     save_as.addActionListener(this);     files.add(open);     files.add(newfile);     files.add(close);     files.add(save);     files.add(save_as);     StudentMenu.add(files);     tools=new Menu("工具箱");     sort=new MenuItem("排序");     delete=new MenuItem("删除");     change=new MenuItem("修改");     insert=new MenuItem("插入");     sort.addActionListener(this);     delete.addActionListener(this);     change.addActionListener(this);     insert.addActionListener(this);     tools.add(sort);     tools.add(delete);     tools.add(change);     tools.add(insert);     StudentMenu.add(tools);     helps=new Menu("帮助");     main_help=new MenuItem("关于主题");     main_help.addActionListener(this);     helps.add(main_help);     StudentMenu.add(helps);//     helps.addActionListener(this);//     fopt=new FrameOutputThen();     setSize(new Dimension(400,400));     setVisible(true) ;     this.setMenuBar( StudentMenu);   }   public void actionPerformed(ActionEvent e)     {       if(e.getActionCommand()=="关闭")       {          dispose();          System.exit(0);       }       else         if(e.getActionCommand()=="关于主题")         {           ta.setText("\n\t您现在使用的是由计算机学院熊殿编写的"                      +"\n\t一个学生信息管理系统。作为一个作业希"                      +"\n\t望它能让您满意.本帮助上需补充,请等待." );         }       else           if(e.getActionCommand()=="新建")           {             newfile.setEnabled(false) ;             open.setEnabled(false) ;  //           newStudent(); //            newfile.setEnabled(false) ; //            newfile.setEnabled(false) ;           }       else           if(e.getActionCommand()=="排序"){}       else           if(e.getActionCommand()=="查找")           {            }       else           if(e.getActionCommand()=="删除"){}       else           if(e.getActionCommand()=="修改"){}       else         ta.setText("\n\n\n\n\n\t\t"+"你选择的是"                    +e.getActionCommand());     }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -