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

📄 main1jframe.java

📁 大学课程 数据库的课程设计
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
        jMenuItem16.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem16ActionPerformed(evt);
            }
        });

        jMenu6.add(jMenuItem16);

        jMenuBar1.add(jMenu6);

        jMenu7.setText("\u9000\u51fa");
        jMenu7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenu7ActionPerformed(evt);
            }
        });

        jMenuItem17.setText("\u9000\u51fa\u7cfb\u7edf");
        jMenuItem17.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem17ActionPerformed(evt);
            }
        });

        jMenu7.add(jMenuItem17);

        jMenuBar1.add(jMenu7);

        setJMenuBar(jMenuBar1);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jSplitPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 871, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jSplitPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 487, Short.MAX_VALUE)
        );
        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItem16ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem16ActionPerformed
// TODO 将在此处添加您的处理代码:
         JOptionPane.showMessageDialog(this,"见帮助文档","提示",JOptionPane.WARNING_MESSAGE);
    }//GEN-LAST:event_jMenuItem16ActionPerformed

    private void jMenuItem15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem15ActionPerformed
// TODO 将在此处添加您的处理代码:
        new VersionFrame().setVisible(true);
    }//GEN-LAST:event_jMenuItem15ActionPerformed

    private void jMenuItem17ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem17ActionPerformed
// TODO 将在此处添加您的处理代码:
        System.exit(0);
    }//GEN-LAST:event_jMenuItem17ActionPerformed

    private void jMenu7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu7ActionPerformed
// TODO 将在此处添加您的处理代码:
        System.exit(0);
    }//GEN-LAST:event_jMenu7ActionPerformed

    private void jMenuItem14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem14ActionPerformed
// TODO 将在此处添加您的处理代码
           try
        {
         Runtime rt = Runtime.getRuntime();
         rt.exec("rundll32 url.dll,FileProtocolHandler  http://bbs.woyaofei.com");
          }catch(Exception  link)
         {
            JOptionPane.showMessageDialog(null,"出现链接异常,请与管理员联系","网络问题",JOptionPane.WARNING_MESSAGE);
         }
    }//GEN-LAST:event_jMenuItem14ActionPerformed

    private void jMenuItem13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem13ActionPerformed
// TODO 将在此处添加您的处理代码:
         try
        {
         Runtime rt = Runtime.getRuntime();
         rt.exec("rundll32 url.dll,FileProtocolHandler  http://www.woyaofei.com");
          }catch(Exception  link)
         {
            JOptionPane.showMessageDialog(null,"出现链接异常,请与管理员联系","网络问题",JOptionPane.WARNING_MESSAGE);
         }

    }//GEN-LAST:event_jMenuItem13ActionPerformed

    private void jMenuItem11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem11ActionPerformed
// TODO 将在此处添加您的处理代码:
          try {
// TODO add your handling code here:
            Process p = Runtime.getRuntime().exec("notepad.exe");
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }//GEN-LAST:event_jMenuItem11ActionPerformed

    private void jMenuItem12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem12ActionPerformed
// TODO 将在此处添加您的处理代码:
          try {
// TODO add your handling code here:
          Process p = Runtime.getRuntime().exec("calc.exe");
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }//GEN-LAST:event_jMenuItem12ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed
// TODO add your handling code here
         ModifyAirJDialog ma = new  ModifyAirJDialog(new Frame(),true);
         ma.setVisible(true);
    }//GEN-LAST:event_jMenuItem9ActionPerformed

    private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
// TODO add your handling code here:
        RealBackTicketJDialog bt = new RealBackTicketJDialog(new Frame(),true);
        bt.setVisible(true);
    }//GEN-LAST:event_jMenuItem7ActionPerformed

    private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
// TODO add your handling code here
        AddAirJDialog aa = new AddAirJDialog(new Frame(),true);
        aa.setVisible(true);
    }//GEN-LAST:event_jMenuItem8ActionPerformed

    private void jComboBox2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox2ActionPerformed
// TODO add your handling code here:
        s2=(String) jComboBox2.getSelectedItem();
    }//GEN-LAST:event_jComboBox2ActionPerformed

    private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
// TODO add your handling code here:
        s2=(String) jComboBox1.getSelectedItem();
    }//GEN-LAST:event_jComboBox1ActionPerformed

    private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
// TODO add your handling code here:
     if(m3==1)
    {
        s2= jTextField1.getText();
    }
        if(s2.equals("请选择"))
            JOptionPane.showMessageDialog(this,"请选择一个对象!","消息对话框",JOptionPane.WARNING_MESSAGE);
        else{
    MyConnection mc = new MyConnection();
    mc.setNumber(n);
    mc.setTablename(s);
    mc.myQuery(s1, s2);
    a=mc.getArray();
    mc.closeConnection();
    jTable1.setModel(new javax.swing.table.DefaultTableModel(a,name));
        }
    }//GEN-LAST:event_jButton1MouseClicked

    private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked
// TODO add your handling code here
        jButton1.setVisible(false);
        jButton2.setVisible(false);
        jComboBox1.setVisible(false);
        jComboBox2.setVisible(false);
        jLabel2.setVisible(false);
        jLabel3.setVisible(false);
        jLabel4.setVisible(false);
        jTextField1.setVisible(false);
    }//GEN-LAST:event_jButton2MouseClicked

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
// TODO add your handling code here:
        jButton1.setVisible(true);
        jButton2.setVisible(true);
        jComboBox1.setVisible(true);
        jComboBox2.setVisible(false);
        jLabel2.setVisible(true);
        jLabel3.setVisible(false);
        jLabel4.setVisible(false);
        jTextField1.setVisible(false);
        m3=0;
    s="特定航班顾客信息";
    s1="航班号";
    n=5;
     name=new String[] {"航班号","旅客姓名","旅客性别","旅客身份证号","座位号"};
     if(m4>0)
    {
        m4--;
    MyConnection mc = new MyConnection();
    mc.itemQuery("航班班次表", "航班号");
    String item[] = mc.getItem();
    int m=mc.getItemNumber();
    mc.closeConnection();
    //System.out.println(item[0]+m);
    for(int i=0;i<m;i++)
        jComboBox1.addItem(item[i]);
    }
    }//GEN-LAST:event_jMenuItem4ActionPerformed

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
// TODO add your handling code here:
        jButton1.setVisible(true);
        jButton2.setVisible(true);
        jComboBox1.setVisible(false);
        jComboBox2.setVisible(false);
        jLabel2.setVisible(false);
        jLabel3.setVisible(false);
        jLabel4.setVisible(true);
        jTextField1.setVisible(true);
        m3=1;
        n=6;
        s="旅客信息";
        s1="旅客身份证";
        name=new String[] {"旅客姓名","旅客性别","旅客身份证号","航班好","座位号","是否取票"};
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
// TODO add your handling code here:
        jButton1.setVisible(true);
        jButton2.setVisible(true);
        jComboBox1.setVisible(false);
        jComboBox2.setVisible(true);
        jLabel2.setVisible(false);
        jLabel3.setVisible(true);
        jLabel4.setVisible(false);
        jTextField1.setVisible(false);
        m3=0;
        n=6;
    name=new String[] {"航班号","起飞时间","飞行目的地","座位空数","商务舱票价","经济舱票价"};
        s="航班班次表";
        s1="飞行目的地";
        if(m5>0)
        {
            m5--;
            int x;
            MyConnection mc = new MyConnection();
           mc.itemQuery("航班班次表","飞行目的地");
           String item[] = mc.getItem();
           int m=mc.getItemNumber();
           mc.closeConnection();
           //System.out.println("dhfd");
           for(int i=0;i<m;i++){
               x=1;
               for(int j=0;j<i;j++){
                   if(item[i].equals(item[j]))
                       x=0;
                }
               if(x==1)
                 jComboBox2.addItem(item[i]);
           }
               
        }
    }//GEN-LAST:event_jMenuItem2ActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
// TODO add your handling code here:
        jButton1.setVisible(true);
        jButton2.setVisible(true);
        jComboBox1.setVisible(true);
        jComboBox2.setVisible(false);
        jLabel2.setVisible(true);
        jLabel3.setVisible(false);
        jLabel4.setVisible(false);
        jTextField1.setVisible(false);
        m3=0;
    name=new String[] {"航班号","起飞时间","飞行目的地","座位空数","商务舱票价","经济舱票价"};
    s="航班班次表";
    s1="航班号";
    n=6;
    if(m2>0)
    {
        m2--;
    MyConnection mc = new MyConnection();
    mc.itemQuery("航班班次表","航班号");
    String item[] = mc.getItem();
    int m=mc.getItemNumber();
    mc.closeConnection();
    //System.out.println(item[0]+m);
    for(int i=0;i<m;i++)
        jComboBox1.addItem(item[i]);
    }
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jMenuItem10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem10ActionPerformed
// TODO add your handling code here:
        DeleteAirJDialog da = new DeleteAirJDialog(new Frame(),true);
        da.setVisible(true);
    }//GEN-LAST:event_jMenuItem10ActionPerformed

    private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
// TODO add your handling code here:
        BackTicketJDialog bt = new BackTicketJDialog(new Frame(),true);
        bt.setVisible(true);
    }//GEN-LAST:event_jMenuItem6ActionPerformed

    private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed
// TODO add your handling code here:
       AddCustomInfJFrame ac = new AddCustomInfJFrame();
       ac.setVisible(true);
    }//GEN-LAST:event_jMenuItem5ActionPerformed
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Main1JFrame().setVisible(true);
            }
        });
    }
    
    // 变量声明 - 不进行修改//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenu jMenu5;
    private javax.swing.JMenu jMenu6;
    private javax.swing.JMenu jMenu7;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem10;
    private javax.swing.JMenuItem jMenuItem11;
    private javax.swing.JMenuItem jMenuItem12;
    private javax.swing.JMenuItem jMenuItem13;
    private javax.swing.JMenuItem jMenuItem14;
    private javax.swing.JMenuItem jMenuItem15;
    private javax.swing.JMenuItem jMenuItem16;
    private javax.swing.JMenuItem jMenuItem17;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JMenuItem jMenuItem8;
    private javax.swing.JMenuItem jMenuItem9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JTable jTable1;
    private javax.swing.JTextField jTextField1;
    // 变量声明结束//GEN-END:variables
    
}

⌨️ 快捷键说明

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