发布时间 : 星期一 文章课程设计选题管理系统更新完毕开始阅读
教师界面:
class teachermainframe extends JPanel implements ActionListener { static final int WIDTH = 1000; static final int HETGHT = 500; private JFrame usermainframe; private JMenu timu,xuanti,xuesheng, help,quanxian; private JMenuItem studentadd,helpa, timuadd,timuchange,timudelete,timusearch,xueshengsearch,xuantiqueren,xuantisearch; public void add(Component c, GridBagConstraints constraints, int x, int y, int w, int h) { constraints.gridx = x; constraints.gridy = y; constraints.gridwidth = w; constraints.gridheight = h; add(c, constraints); } public teachermainframe() { Toolkit kit = Toolkit.getDefaultToolkit(); Dimension screenSize = kit.getScreenSize(); int width = screenSize.width; int height = screenSize.height; int x = (width - WIDTH) / 2; int y = (height - HETGHT) / 2; usermainframe = new JFrame(\选题管理系统---\ usermainframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); GridBagLayout lay = new GridBagLayout(); setLayout(lay); usermainframe.add(this, BorderLayout.WEST);
9
about,
usermainframe.setSize(1000, 500); usermainframe.setLocation(x, y); usermainframe.setResizable(false); usermainframe.setVisible(true); String path = \
ImageIcon background = new ImageIcon(path); JLabel label = new JLabel(background);
label.setBounds(0, 0, usermainframe.getWidth(), usermainframe.getHeight());
JPanel imagePanel = (JPanel) usermainframe.getContentPane(); imagePanel.setOpaque(false);
usermainframe.getLayeredPane().add(label, new Integer(Integer.MIN_VALUE)); JPanel contentPane = new JPanel() { public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; g2.setFont(new Font(\华文行楷\ g2.shear(0.0, 00.0); g2.drawString(\教师界面---\ } };
usermainframe.add(contentPane);
JMenuBar menubar = new JMenuBar(); usermainframe.setJMenuBar(menubar); timu = new JMenu(\题目管理\xuesheng = new JMenu(\学生管理\xuanti = new JMenu(\选题管理\help = new JMenu(\帮助\quanxian = new JMenu(\权限\about = new JMenuItem(\关于\helpa = new JMenuItem(\帮助手册\timuadd = new JMenuItem(\题目添加\timuchange = new JMenuItem(\题目修改\timudelete = new JMenuItem(\题目删除\timusearch = new JMenuItem(\题目查询\xueshengsearch = new JMenuItem(\学生查询\xuantiqueren=new JMenuItem(\选题确认\xuantisearch=new JMenuItem(\选题查询\studentadd = new JMenuItem(\添加用户\menubar.add(timu); menubar.add(xuesheng); menubar.add(xuanti); menubar.add(help); menubar.add(quanxian); quanxian.add(studentadd);
10
}
timu.add(timuadd); timu.add(timuchange); timu.add(timudelete); timu.add(timusearch);
xuesheng.add(xueshengsearch); xuanti.add(xuantiqueren); xuanti.add(xuantisearch); help.add(helpa); help.add(about);
helpa.addActionListener(this); about.addActionListener(this);
xueshengsearch.addActionListener(this); timuadd.addActionListener(this); timuchange.addActionListener(this); timudelete.addActionListener(this); timusearch.addActionListener(this); xuantiqueren.addActionListener(this); xuantisearch.addActionListener(this); studentadd.addActionListener(this);
教师题目管理界面:
public void actionPerformed(ActionEvent e) { Object source = e.getSource(); if (source == about) { String message = \ 课程设计选题管理系统 V1.0 版 \ JOptionPane.showMessageDialog(null, message); } else if (source == helpa) { String message = \ 帮助功能待续... \ JOptionPane.showMessageDialog(null, message); }else if (source == studentadd) {
11
}
}
yonghuaddframe main=new yonghuaddframe(); }else if (source == xueshengsearch) { String sql=\二班'and major='计算机系'\ studentinformationframe main=new studentinformationframe(sql);
}else if (source == timuadd||source ==timuchange||source ==timudelete||source ==timusearch) { String sql=\ timuinformationframe main=new timuinformationframe(sql); }else if (source == xuantiqueren) { timuqurenframe main=new timuqurenframe(); }else if (source == xuantisearch) { timusearchframe main=new timusearchframe(); }
学生管理界面:
12