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

📄 windows.java

📁 java开发的一个基于mysql的小数据库系统
💻 JAVA
字号:
package 桀骜学管理系统;

import java.awt.*;
import java.awt.event.*;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JToolBar;
import javax.swing.JButton;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class windows extends JFrame {
    JPanel contentPane;
    JMenuBar jMenuBar1 = new JMenuBar();
    JMenu jMenuFile = new JMenu();
    JMenuItem jMenuFileExit = new JMenuItem();
    JMenu jMenuHelp = new JMenu();
    JMenuItem jMenuHelpAbout = new JMenuItem();
    JToolBar jToolBar = new JToolBar();
    JButton jButton1 = new JButton();
    JButton jButton2 = new JButton();
    JButton jButton3 = new JButton();
    ImageIcon image1 = new ImageIcon(桀骜学管理系统.windows.class.getResource(
            "openFile.png"));
    ImageIcon image2 = new ImageIcon(桀骜学管理系统.windows.class.getResource(
            "closeFile.png"));
    ImageIcon image3 = new ImageIcon(桀骜学管理系统.windows.class.getResource(
            "help.png"));
    JLabel statusBar = new JLabel();
    XYLayout xYLayout1 = new XYLayout();
    JLabel jLabel1 = new JLabel();
    JLabel jLabel2 = new JLabel();
    JMenuItem jMenuItem1 = new JMenuItem();
    JMenuItem jMenuItem2 = new JMenuItem();
    JMenuItem jMenuItem3 = new JMenuItem();
    JMenuItem jMenuItem4 = new JMenuItem();
    public windows() {
        try {
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    /**
     * Component initialization.
     *
     * @throws java.lang.Exception
     */
    private void jbInit() throws Exception {
        contentPane = (JPanel) getContentPane();
        contentPane.setLayout(xYLayout1);
        setSize(new Dimension(800, 600));
        jLabel1.setFont(new Font("TimesRoman",Font.BOLD,66));
        setTitle("教学管理系统");
        statusBar.setText(" ");
        jMenuFile.setText("系统功能");
        jMenuFileExit.setText("Exit");
        jMenuFileExit.addActionListener(new windows_jMenuFileExit_ActionAdapter(this));
        jMenuHelp.setText("Help");
        jMenuHelpAbout.setText("About");
        jMenuHelpAbout.addActionListener(new
                                         windows_jMenuHelpAbout_ActionAdapter(this));
        jLabel1.setText("教学管理系统");
        jLabel2.setText("开发者 ;孙立中");
        jLabel2.setFont(new Font("TimesRoman",Font.BOLD,30));
        jMenuItem2.setText("学生管理");
        jMenuItem2.addActionListener(new windows_jMenuItem2_actionAdapter(this));
        jMenuItem4.setText("课程变动");
        jMenuItem4.addActionListener(new windows_jMenuItem4_actionAdapter(this));
        jMenuItem3.setText("课程查询");
        jMenuItem3.addActionListener(new windows_jMenuItem3_actionAdapter(this));
        jMenuItem1.addActionListener(new windows_jMenuItem1_actionAdapter(this));
        jMenuItem1.setText("教师查询");
        jMenuBar1.add(jMenuFile);
        jMenuFile.add(jMenuItem1);
        jMenuFile.add(jMenuItem2);
        jMenuFile.add(jMenuItem3);
        jMenuFile.add(jMenuItem4);
        jMenuFile.add(jMenuFileExit);
        jMenuBar1.add(jMenuHelp);
        jMenuHelp.add(jMenuHelpAbout);
        setJMenuBar(jMenuBar1);
        jButton1.setIcon(image1);
        jButton1.setToolTipText("Open File");
        jButton2.setIcon(image2);
        jButton2.setToolTipText("Close File");
        jButton3.setIcon(image3);
        jButton3.setToolTipText("Help");
        jToolBar.add(jButton1);
        jToolBar.add(jButton2);
        jToolBar.add(jButton3);
        contentPane.add(statusBar, new XYConstraints(0, 584, 800, -1));
        contentPane.add(jToolBar, new XYConstraints(0, 0, 800, -1));
        contentPane.add(jLabel1, new XYConstraints(165, 160, 505, 136));
        contentPane.add(jLabel2, new XYConstraints(348, 316, 272, 39));
    }

    /**
     * File | Exit action performed.
     *
     * @param actionEvent ActionEvent
     */
    void jMenuFileExit_actionPerformed(ActionEvent actionEvent) {
        System.exit(0);
    }

    /**
     * Help | About action performed.
     *
     * @param actionEvent ActionEvent
     */
    void jMenuHelpAbout_actionPerformed(ActionEvent actionEvent) {
        windows_AboutBox dlg = new windows_AboutBox(this);
        Dimension dlgSize = dlg.getPreferredSize();
        Dimension frmSize = getSize();
        Point loc = getLocation();
        dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x,
                        (frmSize.height - dlgSize.height) / 2 + loc.y);
        dlg.setModal(true);
        dlg.pack();
        dlg.show();
    }

    public void jMenuItem1_actionPerformed(ActionEvent e) {
        new 教师查询();
        //教师查询1.packFrame(true);
    }

    public void jMenuItem2_actionPerformed(ActionEvent e) {
        new 学生查询 ();
    }

    public void jMenuItem3_actionPerformed(ActionEvent e) {
        new 课程查询();
    }

    public void jMenuItem4_actionPerformed(ActionEvent e) {
         new 课程变动();
    }
}


class windows_jMenuItem4_actionAdapter implements ActionListener {
    private windows adaptee;
    windows_jMenuItem4_actionAdapter(windows adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.jMenuItem4_actionPerformed(e);
    }
}


class windows_jMenuItem3_actionAdapter implements ActionListener {
    private windows adaptee;
    windows_jMenuItem3_actionAdapter(windows adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.jMenuItem3_actionPerformed(e);
    }
}


class windows_jMenuItem2_actionAdapter implements ActionListener {
    private windows adaptee;
    windows_jMenuItem2_actionAdapter(windows adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.jMenuItem2_actionPerformed(e);
    }
}


class windows_jMenuItem1_actionAdapter implements ActionListener {
    private windows adaptee;
    windows_jMenuItem1_actionAdapter(windows adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.jMenuItem1_actionPerformed(e);
    }
}


class windows_jMenuFileExit_ActionAdapter implements ActionListener {
    windows adaptee;

    windows_jMenuFileExit_ActionAdapter(windows adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent actionEvent) {
        adaptee.jMenuFileExit_actionPerformed(actionEvent);
    }
}


class windows_jMenuHelpAbout_ActionAdapter implements ActionListener {
    windows adaptee;

    windows_jMenuHelpAbout_ActionAdapter(windows adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent actionEvent) {
        adaptee.jMenuHelpAbout_actionPerformed(actionEvent);
    }
}

⌨️ 快捷键说明

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