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

📄 busmanageframe.java~258~

📁 济南公交管理系统 (不完善,没有解决循环线路问题)
💻 JAVA~258~
📖 第 1 页 / 共 4 页
字号:
    jRadioButton2.setFont(new java.awt.Font("Serif", 0, 12));
    jRadioButton2.setSelected(true);
    jRadioButton2.setText("查询车次");
    jRadioButton2.setBounds(new Rectangle(82, 33, 75, 25));


    jLabel11.setFont(new java.awt.Font("Serif", 0, 12));
    jLabel11.setText("线路");
    jLabel11.setBounds(new Rectangle(1, 10, 80, 20));
    jLabel12.setFont(new java.awt.Font("Serif", 0, 12));
    jLabel12.setText("起始粘");
    jLabel12.setBounds(new Rectangle(1, 40, 80, 20));
    jLabel13.setFont(new java.awt.Font("Serif", 0, 12));
    jLabel13.setText("上行营运时间");
    jLabel13.setBounds(new Rectangle(180, 40, 80, 20));
    jLabel14.setFont(new java.awt.Font("Serif", 0, 12));
    jLabel14.setText("终点站");
    jLabel14.setBounds(new Rectangle(1, 70, 80, 20));
    jLabel15.setFont(new java.awt.Font("Serif", 0, 12));
    jLabel15.setToolTipText("");
    jLabel15.setText("下行营运时间");
    jLabel15.setBounds(new Rectangle(180, 70, 80, 20));
    jLabel16.setFont(new java.awt.Font("Serif", 0, 12));
    jLabel16.setText("是否空调");
    jLabel16.setBounds(new Rectangle(1, 100, 80, 20));

    jTextField6.setBounds(new Rectangle(90, 40, 80, 20));
    jTextField6.setFont(new java.awt.Font("Serif", 0, 12));
    jTextField6.setBorder(BorderFactory.createLineBorder(Color.black));
    jTextField6.setText("");
    jTextField7.setBounds(new Rectangle(270, 40, 80, 20));
    jTextField7.setFont(new java.awt.Font("Serif", 0, 12));
    jTextField7.setBorder(BorderFactory.createLineBorder(Color.black));
    jTextField7.setText("");
    jTextField8.setBounds(new Rectangle(90, 70, 80, 20));
    jTextField8.setFont(new java.awt.Font("Serif", 0, 12));
    jTextField8.setBorder(BorderFactory.createLineBorder(Color.black));
    jTextField8.setText("");
    jTextField9.setBounds(new Rectangle(270, 70, 80, 20));
    jTextField9.setFont(new java.awt.Font("Serif", 0, 12));
    jTextField9.setBorder(BorderFactory.createLineBorder(Color.black));
    jTextField9.setText("");
    jTextField10.setBounds(new Rectangle(90, 100, 80, 20));
    jTextField10.setFont(new java.awt.Font("Serif", 0, 12));
    jTextField10.setBorder(BorderFactory.createLineBorder(Color.black));
    jTextField10.setText("");

    jButton16.setBackground(SystemColor.inactiveCaptionText);
    jButton16.setBounds(new Rectangle(80, 140, 75, 30));
    jButton16.setFont(new java.awt.Font("Serif", 0, 13));
    jButton16.setText("修改");
    jButton16.addActionListener(new busmanageFrame_jButton16_actionAdapter(this));

    jButton17.setBackground(Color.white);
    jButton17.setBounds(new Rectangle(180, 10, 46, 21));
    jButton17.setFont(new java.awt.Font("Serif", 0, 12));
    jButton17.addActionListener(new busmanageFrame_jButton17_actionAdapter(this));
    jButton17.setIcon(button);

    jButton18.setBackground(SystemColor.inactiveCaptionText);
    jButton18.setBounds(new Rectangle(170, 140, 75, 30));
    jButton18.setFont(new java.awt.Font("Serif", 0, 12));
    jButton18.setText("删除");
    jButton18.addActionListener(new busmanageFrame_jButton18_actionAdapter(this));

    jPanel6.setBounds(new Rectangle(2, 180, 350, 50));
    jPanel6.setLayout(null);
    jPanel6.setBackground(SystemColor.inactiveCaptionText);
    jPanel6.setBorder(BorderFactory.createEtchedBorder());
    jTextArea4.setBackground(SystemColor.inactiveCaptionText);
    jTextArea4.setFont(new java.awt.Font("Serif", 0, 12));
    jTextArea4.setForeground(Color.black);
    jTextArea4.setEditable(false);
    jTextArea4.setText("(线路属性管理:先选择线路,然后进行查询。文本框显示某一车\n次的属性,可以进行修改属性和删除线路操作。)");
    jTextArea4.setBounds(new Rectangle(1, 1, 347, 40));


    jComboBox1.setBounds(new Rectangle(90, 10, 80, 20));

    jLabel17.setFont(new java.awt.Font("Serif", 0, 13));
    jLabel17.setForeground(Color.green);
    jLabel17.setText("CopyRight@2006-2007  zhangyubo@mail.sdu.edu.cn");
    jLabel17.setBounds(new Rectangle(139, 2, 324, 20));
    jPanel11.setBackground(SystemColor.textHighlight);
    jPanel11.setBorder(BorderFactory.createLineBorder(Color.black));
    jPanel11.setBounds(new Rectangle(0, 276, 600, 40));
    jPanel11.setLayout(null);
    jPanel12.setBackground(SystemColor.inactiveCaptionText);
    jPanel12.setBorder(BorderFactory.createEtchedBorder());
    jPanel12.setBounds(new Rectangle(351, 136, 201, 107));
    jPanel12.setLayout(null);
    jTextArea3.setBackground(SystemColor.inactiveCaptionText);
    jTextArea3.setFont(new java.awt.Font("Serif", 0, 12));
    jTextArea3.setForeground(Color.black);
    jTextArea3.setEditable(false);
    jTextArea3.setText("(请先进行查询或者是增加车次操作,\n然后进行相应的添加删除或者是修改\n操作。\n进行添加删除和修改操作是针对某一\n具体线路。)");
    jTextArea3.setBounds(new Rectangle(1, 1, 198, 104));

    jPanel13.setBackground(SystemColor.inactiveCaptionText);
    jPanel13.setBorder(BorderFactory.createEtchedBorder());
    jPanel13.setBounds(new Rectangle(310, 15, 30, 220));//文档编辑帮助panel
    jPanel13.setLayout(null);
    jPanel14.setBackground(SystemColor.inactiveCaptionText);
    jPanel14.setBorder(BorderFactory.createEtchedBorder());
    jPanel14.setBounds(new Rectangle(310, 15, 30, 220));
    jPanel14.setLayout(null);
    jTextArea5.setBackground(SystemColor.inactiveCaptionText);
    jTextArea5.setFont(new java.awt.Font("Serif", 0, 12));
    jTextArea5.setText("先点\n击读\n取,\n在文\n本域\n中进\n行编\n辑,\n然后\n点击\n编辑\n保存。");
    jTextArea5.setBounds(new Rectangle(1, 1, 28, 218));
    jTextArea6.setBackground(SystemColor.inactiveCaptionText);
    jTextArea6.setFont(new java.awt.Font("Serif", 0, 12));
    jTextArea6.setText("先点\n击读\n取,\n在文\n本域\n中进\n行编\n辑,\n然后\n点击\n编辑\n保存。");
    jTextArea6.setBounds(new Rectangle(1, 1, 28, 218));

    ImageIcon hi=new ImageIcon("picture/9.jpg");
//    ImageIcon hi=new ImageIcon("picture/hi.gif");
    jLabel1.setText("");
    jLabel1.setBounds(new Rectangle(350, 10, 237, 200));
    jLabel1.setIcon(hi);
    jLabel2.setText("");
    jLabel2.setBounds(new Rectangle(350, 10, 237, 200));
    jLabel2.setIcon(hi);
    jLabel3.setText("");
    jLabel3.setBounds(new Rectangle(350, 10, 237, 200));
    jLabel3.setIcon(hi);

    bg.add(jRadioButton1);
    bg.add(jRadioButton2);

    contentPane.add(jPanel2, null);
    jPanel3.add(jButton1, null);
    jPanel3.add(jButton2, null);
    jPanel3.add(jButton4, null);
    jPanel3.add(jButton6, null);
    jPanel3.add(jButton5, null);
    jPanel2.add(jPanel11, null);
    jPanel11.add(jLabel17, null);

    contentPane.add(jPanel1, null);
    jPanel1.add(jLabel7, null);

    jPanel2.add(jPanel4, null);
    jPanel2.add(jPanel5, null);
    jPanel2.add(jPanel7, null);
    jPanel7.add(jScrollPane1, null);
    jPanel7.add(jButton7, null);
    jPanel7.add(jButton8, null);
    jPanel7.add(jPanel13, null);
    jPanel13.add(jTextArea5, null);
    jPanel7.add(jLabel2, null);
    jScrollPane1.getViewport().add(jTextArea1, null);
    jPanel2.add(jPanel8, null);
    jPanel8.add(jScrollPane2, null);
    jPanel8.add(jButton9, null);
    jPanel8.add(jButton10, null);
    jPanel8.add(jPanel14, null);
    jPanel14.add(jTextArea6, null);
    jPanel8.add(jLabel3, null);
    jPanel2.add(jPanel3, null);
    jScrollPane2.getViewport().add(jTextArea2, null);

    jPanel5.add(jLabel11, null);
    jPanel5.add(jLabel12, null);
    jPanel5.add(jLabel13, null);
    jPanel5.add(jLabel14, null);
    jPanel5.add(jLabel15, null);
    jPanel5.add(jLabel16, null);
    jPanel5.add(jTextField6, null);
    jPanel5.add(jTextField7, null);
    jPanel5.add(jTextField8, null);
    jPanel5.add(jTextField9, null);
    jPanel5.add(jTextField10, null);
    jPanel5.add(jButton16, null);
    jPanel5.add(jButton17, null);
    jPanel5.add(jComboBox1, null);
    jPanel5.add(jButton18, null);
    jPanel5.add(jPanel6, null);
    jPanel6.add(jTextArea4, null);
    jPanel5.add(jLabel1, null);
    jPanel4.add(jTextField1, null);
    jPanel4.add(jButton11, null);
    jPanel9.add(jButton13, null);
    jPanel9.add(jButton12, null);
    jPanel9.add(jButton15, null);
    jPanel9.add(jButton14, null);
    jPanel10.add(jLabel8, null);
    jPanel10.add(jLabel10, null);
    jPanel10.add(jTextField2, null);
    jPanel10.add(jTextField4, null);
    jPanel10.add(jTextField3, null);
    jPanel10.add(jLabel9, null);
    jPanel12.add(jTextArea3, null);


    createtable();

  }
  public void addpicture()
  {
//加入图片到数据库
    ImageIcon l1=new ImageIcon("picture/1.jpg");
    ImageIcon l2=new ImageIcon("picture/2.jpg");
    ImageIcon l3=new ImageIcon("picture/3.jpg");
    ImageIcon l4=new ImageIcon("picture/4.jpg");
    ImageIcon l5=new ImageIcon("picture/5.jpg");
    ImageIcon l6=new ImageIcon("picture/6.jpg");
    ImageIcon l7=new ImageIcon("picture/7.jpg");
    ImageIcon l8=new ImageIcon("picture/8.jpg");
    ImageIcon l9=new ImageIcon("picture/9.jpg");
    ImageIcon l10=new ImageIcon("picture/10.jpg");
    ImageIcon l11=new ImageIcon("picture/11.jpg");
    ImageIcon l12=new ImageIcon("picture/12.jpg");
    ImageIcon l13=new ImageIcon("picture/13.jpg");
    String sql="insert into businfo(图片) values(l1) where 车次号=1";
  }
  //Overridden so we can exit when window is closed
  protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
      System.exit(0);
    }
  }

  void jMenuItem2_actionPerformed(ActionEvent e) {
    //系统退出
    this.dispose();
    //System.exit(0);
  }

  void jButton6_actionPerformed(ActionEvent e) {
    //系统退出
    this.dispose();
    new client();
    //this.setVisible(false);
    //System.exit(0);
  }

  void jButton1_actionPerformed(ActionEvent e) {
    jPanel4.setVisible(true);
    jPanel5.setVisible(false);
    jPanel7.setVisible(false);
    jPanel8.setVisible(false);
  }

  void jButton2_actionPerformed(ActionEvent e) {
    //线路管理
    jPanel4.setVisible(false);
    jPanel5.setVisible(true);
    jPanel7.setVisible(false);
    jPanel8.setVisible(false);

    String sql = "select 车次号 from businfo";
    String checi;
    Vector vector = new Vector();
    try {
      ResultSet rs = stmt.executeQuery(sql);
      while (rs.next()) {
        checi = rs.getString("车次号");
        vector.addElement(checi);
      }
      rs.close();
      int length = vector.size();
      for (int i = 0; i < length; i++) {
        jComboBox1.addItem(vector.get(i));
      }
    }
    catch (SQLException sqle) {

    }
  }

  void jButton3_actionPerformed(ActionEvent e) {
    jPanel4.setVisible(false);
    jPanel5.setVisible(false);
    jPanel7.setVisible(false);
    jPanel8.setVisible(false);

  }

  void jButton4_actionPerformed(ActionEvent e) {
    jPanel4.setVisible(false);
    jPanel5.setVisible(false);
    jPanel7.setVisible(true);
    jPanel8.setVisible(false);

  }

  void jButton5_actionPerformed(ActionEvent e) {
    jPanel4.setVisible(false);
    jPanel5.setVisible(false);
    jPanel7.setVisible(false);
    jPanel8.setVisible(true);

  }

  void jButton8_actionPerformed(ActionEvent e) {
    //读取济南公交公司资料
    readjnbus();
    jTextArea1.setText(jnbustxt);
    jButton8.setEnabled(false);
    jButton7.setEnabled(true);
  }

  void jButton7_actionPerformed(ActionEvent e) {
    //编辑公交公司资料
    writejnbus();
    jButton8.setEnabled(true);
  }

  void jButton9_actionPerformed(ActionEvent e) {
    //读取帮助
    readhelp();
    jTextArea2.setText(helptxt);
    jButton9.setEnabled(false);
    jButton10.setEnabled(true);
  }

  void jButton10_actionPerformed(ActionEvent e) {
    //编辑帮助文档
    writehelp();
    jButton9.setEnabled(true);
  }

  String title[] = {
      "车次号", "序号", "站点名"}; //二维表列名
  Vector vector;
  JScrollPane scroll;
  AbstractTableModel tm;
  JButton jButton12 = new JButton();
  JButton jButton13 = new JButton();
  JButton jButton14 = new JButton();
  JPanel jPanel9 = new JPanel();
  JPanel jPanel10 = new JPanel();
  JLabel jLabel8 = new JLabel();
  JTextField jTextField2 = new JTextField();
  JLabel jLabel9 = new JLabel();
  JTextField jTextField3 = new JTextField();
  JLabel jLabel10 = new JLabel();
  JTextField jTextField4 = new JTextField();
  JButton jButton15 = new JButton();
  JRadioButton jRadioButton1 = new JRadioButton();
  JRadioButton jRadioButton2 = new JRadioButton();
  void createtable() {
    JTable table;
    vector = new Vector();
    tm = new AbstractTableModel() {
      public int getColumnCount() {
        //取得表格列数
        return title.length;
      }

      public int getRowCount() {
        //取得表格行数
        return vector.size();
      }

      public Object getValueAt(int row, int column) {
        //取得单元格中的属性值
        if (!vector.isEmpty()) {
          return ( (Vector) vector.elementAt(row)).elementAt(column);
        }
        else {
          return null;
        }
      }

      public void setValueAt(Object value, int row, int column) {
        //数据模型不可编辑,该方法设置为空
      }

      public String getColumnName(int column) {
        //取得表格列名
        return title[column];
      }

      public Class getColumnClass(int c) {
        //取得列所属对象类
        return getValueAt(0, c).getClass();
      }

      public boolean isCellEditable(int row, int column) {
        //设置单元格不可编辑
        return false;
      }
    };
    table = new JTable(tm); //生成自己的数据模型
    table.setToolTipText("路线"); //设置帮助提示
    table.setAutoResizeMode(table.AUTO_RESIZE_OFF); //设置表格调整尺寸模式
    table.setCellSelectionEnabled(true); //设置单元格选择方式
    table.setShowHorizontalLines(true); //设置是否显示单元格之间的分割线
    table.setShowVerticalLines(true);
    table.setFont(new Font("MS Sans Serif", 0, 13));
    table.setBackground(SystemColor.inactiveCaptionText);
    table.setForeground(SystemColor.activeCaption);

    scroll = new JScrollPane(table);
    scroll.getViewport().setBackground(SystemColor.inactiveCaptionText);
    scroll.setFont(new java.awt.Font("Serif", 0, 12));
    scroll.setForeground(SystemColor.activeCaption);
    scroll.setBounds(new Rectangle(3, 57, 230, 189));
    jPanel4.add(jTextField1, null);
    jPanel4.add(jButton11, null);
    jPanel4.add(jTextField1, null);
    jPanel4.add(jButton11, null);
    jPanel4.add(jTextField1, null);
    jPanel4.add(jButton11, null);
    jPanel4.add(jButton11, null);
    jPanel4.add(jButton11, null);
    //jPanel4.add(jLabel2, null);
    jPanel4.add(jTextField1, null);
    jPanel4.add(jButton11, null);
    jPanel4.add(jButton11, null);
    jPanel4.add(jPanel9, null);

⌨️ 快捷键说明

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