dialog_student_search.java~6~

来自「学生上机系统,请大家多多指教.以后会发」· JAVA~6~ 代码 · 共 83 行

JAVA~6~
83
字号
package student_computer;import java.awt.*;import javax.swing.*;import com.borland.dx.sql.dataset.*;import com.borland.dbswing.*;import com.borland.dx.dataset.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2006</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class Dialog_student_search extends JDialog {  JPanel panel1 = new JPanel();  BorderLayout borderLayout1 = new BorderLayout();  FlowLayout flowLayout1 = new FlowLayout();  JLabel jLabel1 = new JLabel();  JTextField jTextField1 = new JTextField();  JButton jButton1 = new JButton();  JPanel jPanel1 = new JPanel();  BorderLayout borderLayout2 = new BorderLayout();  Database database1 = new Database();  QueryDataSet queryDataSet1 = new QueryDataSet();  JdbNavToolBar jdbNavToolBar1 = new JdbNavToolBar();  TableScrollPane tableScrollPane1 = new TableScrollPane();  JdbTable jdbTable1 = new JdbTable();  JdbStatusLabel jdbStatusLabel1 = new JdbStatusLabel();  QueryDataSet queryDataSet2 = new QueryDataSet();  ParameterRow parameterRow1 = new ParameterRow();  Column column1 = new Column();  public Dialog_student_search(Frame frame, String title, boolean modal) {    super(frame, title, modal);    try {      jbInit();      pack();    }    catch(Exception ex) {      ex.printStackTrace();    }  }  public Dialog_student_search() {    this(null, "", false);  }  private void jbInit() throws Exception {    panel1.setLayout(flowLayout1);    this.getContentPane().setLayout(borderLayout1);    jLabel1.setText("jLabel1");    jTextField1.setText("jTextField1");    jButton1.setText("jButton1");    jPanel1.setLayout(borderLayout2);    database1.setConnection(new com.borland.dx.sql.dataset.ConnectionDescriptor("jdbc:microsoft:sqlserver://210.30.104.11:1433;DatabaseName=student_computer", "xueli", "gejingguo", false, "com.microsoft.jdbc.sqlserver.SQLServerDriver"));    queryDataSet1.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(database1, "select * from student;", null, true, Load.ALL));    jdbStatusLabel1.setText("jdbStatusLabel1");    jdbTable1.setDataSet(queryDataSet1);    column1.setColumnName("student_num");    column1.setDataType(com.borland.dx.dataset.Variant.STRING);    column1.setPreferredOrdinal(0);    column1.setServerColumnName("NewColumn1");    column1.setSqlType(0);    parameterRow1.setColumns(new Column[] {column1});    queryDataSet2.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(database1, "select * from student where student_number=:student_num;", parameterRow1, true, Load.ALL));    getContentPane().add(panel1,  BorderLayout.NORTH);    panel1.add(jLabel1, null);    panel1.add(jTextField1, null);    panel1.add(jButton1, null);    this.getContentPane().add(jPanel1, BorderLayout.CENTER);    jPanel1.add(jdbNavToolBar1, BorderLayout.NORTH);    jPanel1.add(tableScrollPane1, BorderLayout.CENTER);    jPanel1.add(jdbStatusLabel1,  BorderLayout.SOUTH);    tableScrollPane1.getViewport().add(jdbTable1, null);    this.setTitle("学生信息查询");    this.setSize(new Dimension(421, 347));    //this.setLocation(200,200);    this.setVisible(true);  }}

⌨️ 快捷键说明

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