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

📄 ddcx.java

📁 小程序 自己写的 请多多指教 希望高手不吝赐教
💻 JAVA
字号:
import java.awt.*;
import java.awt.event.*;
import java.sql.*;

import javax.swing.*;
import java.awt.Window;
 class ddcx extends Frame implements ActionListener
{  private condb conc=null;
   private ResultSet rs=null;
   private String sql=null;
   private Label chao=new Label("调度编号:");
   private Label cjb=new Label("调度方式:");
   private Label cfj=new Label("调度数量:");
   private Label csf=new Label("目的地:");
   private Label in=new Label("客户地址");
   private TextField chaotx=new TextField();
   private Label cjbtx=new Label("");
   private Label cfjtx=new Label("");
   private Label csftx=new Label("");
   private Label intx=new Label("");
   private Button cx=new Button("查询");
   private Button tc=new Button("退出");
  public ddcx()
  { setTitle("调度信息查询");
    setSize(400,250);
    setBackground(Color.LIGHT_GRAY);
    this.setLocationRelativeTo(this.getParent());
    this.setResizable(false);
    setLayout(null);
    chao.setBounds(80,50,50,20);
    cjb.setBounds(80,80,50,20);
    cfj.setBounds(80,110,50,20);
    csf.setBounds(80,140,50,20);
    in.setBounds(80,170,50,20);
    intx.setBounds(160,170,150,20);
    chaotx.setBounds(160,50,150,20);
    cjbtx.setBounds(160,80,150,20);
    cfjtx.setBounds( 160,110,150,20);
    csftx.setBounds(160,140,150,20);
    cx.setBounds(60,205,50,20);
    tc.setBounds(300,205,50,20);
    add(chao);
    add(cjb);
    add(in);
    add(cfj);
    add(csf);
    add(intx);
    add(cjbtx);
    add(cfjtx);
    add(chaotx);
    add(csftx);
    add(cx);
    add(tc);
    setVisible(true);
    cx.addActionListener(this);
    tc.addActionListener(this);
    addWindowListener(new WindowAdapter()
                      { public void windowClosing(WindowEvent e)
                         {dispose();}
                       }
                      );  
 }
  public void actionPerformed(ActionEvent e)
  { if(e.getActionCommand().equals("退出"))
      this.dispose();
    if(e.getActionCommand().equals("查询"))
     { conc=new condb();
       sql="select * from 调度管理 where 调度编号='"+chaotx.getText()+"'";
        try { 
              rs=conc.getrs(conc.con,sql);
        	  if(rs.next())
        	  
        	  {
              cjbtx.setText(rs.getString("调度方式"));
              cfjtx.setText(rs.getString("调度数量"));
              csftx.setText(rs.getString("目的地"));
              intx.setText(rs.getString("客户地址"));
              conc.dbclose(conc.con,rs);
              conc=null;
              rs=null;}
             
             else {JOptionPane jop=new JOptionPane();
                   jop.showConfirmDialog(null,"该用户不存在!","警告",-1);
                   }
           }catch(Exception ee){}
     }
   
}
}

⌨️ 快捷键说明

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