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

📄 statisticdialog.java~40~

📁 是适合于使用的管理系统 可以在现实中使用
💻 JAVA~40~
字号:
package mysiloer;

import java.awt.*;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

/**
 * <p>Title: MySiloer</p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2005</p>
 *
 * <p>Company: yskey</p>
 *
 * @author 杨涛
 * @version 1.0
 */
public class StatisticDialog
    extends JDialog {
  JPanel panel1 = new JPanel();
  JLabel jLabel1 = new JLabel();
  JLabel jLabel2 = new JLabel();
  JTextField startField = new JTextField();
  JLabel jLabel3 = new JLabel();
  JTextField endField = new JTextField();
  JButton statisticButt = new JButton();
  JButton cancelButt = new JButton();
  GridBagLayout gridBagLayout1 = new GridBagLayout();
  MainFrame frmae = null;
  Connection con = null;
  StatisticPanel sPanel = null;
  public StatisticDialog(JFrame frame, StatisticPanel panel, boolean modal) {
    super(frame, "统计查询对话框", modal);
    try {
      con = panel.dataBase.connection;
      setDefaultCloseOperation(DISPOSE_ON_CLOSE);
      jbInit();
      pack();
    }
    catch (Exception exception) {
      exception.printStackTrace();
    }
  }

  private void jbInit() throws Exception {
    panel1.setLayout(gridBagLayout1);
    jLabel1.setText("请输入要统计的时间段:");
    jLabel2.setText("起始时间:");
    startField.setText("");
    jLabel3.setText("终止时间:");
    endField.setText("");
    statisticButt.setText("统计查询");
    statisticButt.addActionListener(new
                                    StatisticDialog_statisticButt_actionAdapter(this));
    cancelButt.setText("取    消");
    cancelButt.addActionListener(new StatisticDialog_cancelButt_actionAdapter(this));
    this.setResizable(false);
    getContentPane().add(panel1);
    panel1.add(jLabel1, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0
                                               , GridBagConstraints.WEST,
                                               GridBagConstraints.NONE,
                                               new Insets(16, 17, 0, 36), 3, 9));
    panel1.add(jLabel2, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0
                                               , GridBagConstraints.WEST,
                                               GridBagConstraints.NONE,
                                               new Insets(17, 17, 0, 0), 0, 0));
    panel1.add(jLabel3, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0
                                               , GridBagConstraints.WEST,
                                               GridBagConstraints.NONE,
                                               new Insets(17, 0, 0, 132), 0, 0));
    panel1.add(endField, new GridBagConstraints(2, 1, 1, 1, 1.0, 0.0
                                                , GridBagConstraints.WEST,
                                                GridBagConstraints.HORIZONTAL,
                                                new Insets(14, 62, 0, 16), 112,
                                                0));
    panel1.add(startField, new GridBagConstraints(0, 1, 2, 1, 1.0, 0.0
                                                  , GridBagConstraints.WEST,
                                                  GridBagConstraints.HORIZONTAL,
                                                  new Insets(14, 76, 0, 0), 112,
                                                  0));
    panel1.add(statisticButt, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0
        , GridBagConstraints.CENTER, GridBagConstraints.NONE,
        new Insets(45, 12, 42, 14), 8, 6));
    panel1.add(cancelButt, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0
                                                  , GridBagConstraints.CENTER,
                                                  GridBagConstraints.NONE,
                                                  new Insets(45, 37, 42, 75), 8,
                                                  6));
  }

  public void cancelButt_actionPerformed(ActionEvent e) {
    this.setVisible(false);
    this.dispose();
  }

  public void statisticButt_actionPerformed(ActionEvent e) {
    try{
//      String startTime =
      Statement sta = con.createStatement();
//      ResultSet set;
    }
    catch(SQLException ex){

    }
  }
}

class StatisticDialog_statisticButt_actionAdapter
    implements ActionListener {
  private StatisticDialog adaptee;
  StatisticDialog_statisticButt_actionAdapter(StatisticDialog adaptee) {
    this.adaptee = adaptee;
  }

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

class StatisticDialog_cancelButt_actionAdapter
    implements ActionListener {
  private StatisticDialog adaptee;
  StatisticDialog_cancelButt_actionAdapter(StatisticDialog adaptee) {
    this.adaptee = adaptee;
  }

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

⌨️ 快捷键说明

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