MainFrame.java~144~
上传用户:liming9091
上传日期:2014-10-27
资源大小:3376k
文件大小:36k
源码类别:

Java编程

开发平台:

Java

  1. package stumanage;
  2. import javax.swing.*;
  3. import javax.swing.plaf.*;
  4. import com.borland.dbswing.*;
  5. import java.awt.*;
  6. import com.borland.jbcl.layout.*;
  7. import com.borland.dx.sql.dataset.*;
  8. import com.borland.dx.dataset.*;
  9. import java.awt.event.*;
  10. /**
  11.  * <p>Title: </p>
  12.  * <p>Description: </p>
  13.  * <p>Copyright: Copyright (c) 2003</p>
  14.  * <p>Company: </p>
  15.  * @author not attributable
  16.  * @version 1.0
  17.  */
  18. public class MainFrame
  19.     extends JFrame {
  20.   PaneLayout paneLayout1 = new PaneLayout();
  21.   JTabbedPane jTabbedPane1 = new JTabbedPane();
  22.   JPanel jPanel1 = new JPanel();
  23.   JPanel jPanel2 = new JPanel();
  24.   JPanel jPanel3 = new JPanel();
  25.   JPanel jPanel4 = new JPanel();
  26.   JPanel jPanel5 = new JPanel();
  27.   BorderLayout borderLayout1 = new BorderLayout();
  28.   JdbNavToolBar jdbNavToolBar1 = new JdbNavToolBar();
  29.   BorderLayout borderLayout2 = new BorderLayout();
  30.   Database database1 = new Database();
  31.   JPanel jPanel6 = new JPanel();
  32.   BorderLayout borderLayout3 = new BorderLayout();
  33.   JPanel jPanel7 = new JPanel();
  34.   JPanel jPanel8 = new JPanel();
  35.   FlowLayout flowLayout1 = new FlowLayout();
  36.   JLabel jLabel1 = new JLabel();
  37.   JLabel jLabel2 = new JLabel();
  38.   JLabel jLabel3 = new JLabel();
  39.   JLabel jLabel4 = new JLabel();
  40.   JLabel jLabel5 = new JLabel();
  41.   JLabel jLabel6 = new JLabel();
  42.   JLabel jLabel7 = new JLabel();
  43.   JButton jButton1 = new JButton();
  44.   JButton jButton2 = new JButton();
  45.   TableScrollPane tableScrollPane1 = new TableScrollPane();
  46.   JdbTable jdbTable1 = new JdbTable();
  47.   QueryDataSet queryDataSet2 = new QueryDataSet();
  48.   Column column8 = new Column();
  49.   Column column9 = new Column();
  50.   Column column10 = new Column();
  51.   Column column11 = new Column();
  52.   Column column12 = new Column();
  53.   Column column13 = new Column();
  54.   Column column14 = new Column();
  55.   Font font1;
  56.   BorderLayout borderLayout4 = new BorderLayout();
  57.   JPanel jPanel9 = new JPanel();
  58.   JLabel jLabel8 = new JLabel();
  59.   JLabel jLabel9 = new JLabel();
  60.   JLabel jLabel10 = new JLabel();
  61.   JLabel jLabel11 = new JLabel();
  62.   JdbNavToolBar jdbNavToolBar2 = new JdbNavToolBar();
  63.   JPanel jPanel10 = new JPanel();
  64.   JPanel jPanel11 = new JPanel();
  65.   JPanel jPanel12 = new JPanel();
  66.   BorderLayout borderLayout5 = new BorderLayout();
  67.   JLabel jLabel12 = new JLabel();
  68.   TableScrollPane tableScrollPane2 = new TableScrollPane();
  69.   JdbTable jdbTable2 = new JdbTable();
  70.   JLabel jLabel13 = new JLabel();
  71.   TableScrollPane tableScrollPane3 = new TableScrollPane();
  72.   BorderLayout borderLayout6 = new BorderLayout();
  73.   JButton jButton3 = new JButton();
  74.   JButton jButton4 = new JButton();
  75.   XYLayout xYLayout1 = new XYLayout();
  76.   QueryDataSet queryDataSet1 = new QueryDataSet();
  77.   Column column1 = new Column();
  78.   Column column2 = new Column();
  79.   Column column3 = new Column();
  80.   Column column4 = new Column();
  81.   Column column5 = new Column();
  82.   Column column6 = new Column();
  83.   Column column7 = new Column();
  84.   JdbTable jdbTable3 = new JdbTable();
  85.   JLabel jLabel14 = new JLabel();
  86.   JLabel jLabel15 = new JLabel();
  87.   JPanel jPanel13 = new JPanel();
  88.   JLabel jLabel16 = new JLabel();
  89.   JLabel jLabel17 = new JLabel();
  90.   BorderLayout borderLayout7 = new BorderLayout();
  91.   JPanel jPanel14 = new JPanel();
  92.   JPanel jPanel15 = new JPanel();
  93.   TableScrollPane tableScrollPane4 = new TableScrollPane();
  94.   BorderLayout borderLayout8 = new BorderLayout();
  95.   BorderLayout borderLayout9 = new BorderLayout();
  96.   JPanel jPanel16 = new JPanel();
  97.   JPanel jPanel17 = new JPanel();
  98.   JPanel jPanel18 = new JPanel();
  99.   JdbTable jdbTable4 = new JdbTable();
  100.   GridBagLayout gridBagLayout1 = new GridBagLayout();
  101.   JLabel jLabel18 = new JLabel();
  102.   JLabel jLabel19 = new JLabel();
  103.   JdbTextField jdbTextField1 = new JdbTextField();
  104.   JdbTextField jdbTextField2 = new JdbTextField();
  105.   JdbTextArea jdbTextArea1 = new JdbTextArea();
  106.   BorderLayout borderLayout10 = new BorderLayout();
  107.   JButton jButton5 = new JButton();
  108.   JButton jButton6 = new JButton();
  109.   BorderLayout borderLayout11 = new BorderLayout();
  110.   JLabel jLabel20 = new JLabel();
  111.   JdbTextField jdbTextField3 = new JdbTextField();
  112.   JdbTextField jdbTextField4 = new JdbTextField();
  113.   JdbTextField jdbTextField5 = new JdbTextField();
  114.   JdbTextField jdbTextField7 = new JdbTextField();
  115.   JdbTextField jdbTextField8 = new JdbTextField();
  116.   JPanel jPanel19 = new JPanel();
  117.   GridBagLayout gridBagLayout2 = new GridBagLayout();
  118.   ButtonGroup buttonGroup1 = new ButtonGroup();
  119.   JdbRadioButton jdbRadioButton2 = new JdbRadioButton();
  120.   JdbRadioButton jdbRadioButton1 = new JdbRadioButton();
  121.   JdbNavField jdbNavField1 = new JdbNavField();
  122.   JdbTextField jdbTextField9 = new JdbTextField();
  123.   JdbTextField jdbTextField10 = new JdbTextField();
  124.   QueryDataSet queryDataSet4 = new QueryDataSet();
  125.   QueryDataSet qSet_course = new QueryDataSet();
  126.   Column column15 = new Column();
  127.   Column column16 = new Column();
  128.   Column column18 = new Column();
  129.   Column column19 = new Column();
  130.   JdbTextField jdbTextField11 = new JdbTextField();
  131.   JdbNavField jdbNavField2 = new JdbNavField();
  132.   JdbNavField jdbNavField3 = new JdbNavField();
  133.   JdbTextField jdbTextField12 = new JdbTextField();
  134.   JdbTextField jdbTextField13 = new JdbTextField();
  135.   JdbTextField jdbTextField14 = new JdbTextField();
  136.   QueryDataSet qSet_jiangli = new QueryDataSet();
  137.   Column column17 = new Column();   Column column20 = new Column();   Column column21 = new Column();   Column column22 = new Column();   Column column23 = new Column();   Column column24 = new Column();   Column column25 = new Column();
  138.   public MainFrame() {
  139.     try {
  140.       jbInit();
  141.     }
  142.     catch (Exception e) {
  143.       e.printStackTrace();
  144.     }
  145.   }
  146.   public static void main(String[] args) {
  147.     try {
  148.       UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  149.     }
  150.     catch (Exception e) {
  151.     }
  152.     //System.out.println(new javax.swing.UIManager());
  153.     Font f = new java.awt.Font("SansSerif", 0, 12);
  154. UIManager.put("Label.font",f);
  155. UIManager.put("Label.foreground",Color.black);
  156. UIManager.put("Button.font",f);
  157. UIManager.put("Menu.font",f);
  158. UIManager.put("MenuItem.font",f);
  159. UIManager.put("List.font",f);
  160. UIManager.put("CheckBox.font",f);
  161. UIManager.put("RadioButton.font",f);
  162. UIManager.put("ComboBox.font",f);
  163.     UIManager.put("TextArea.font",f);
  164.     UIManager.put("dbTextArea.font",f);
  165.     UIManager.put("font",f);
  166.     MainFrame mainFrame = new MainFrame();
  167.     mainFrame.setFont(new java.awt.Font("SansSerif", 0, 12));
  168.     mainFrame.pack();
  169.     mainFrame.setSize(600,450);
  170.     mainFrame.show();
  171.   }
  172.   private void jbInit() throws Exception {
  173.     font1 = new java.awt.Font("SansSerif", 0, 12);
  174.     this.getContentPane().setLayout(paneLayout1);
  175.     jPanel1.setLayout(borderLayout1);
  176.     jdbNavToolBar1.setDebugGraphicsOptions(0);
  177.     jdbNavToolBar1.setAlignment(FlowLayout.CENTER);
  178.     jPanel5.setLayout(borderLayout2);
  179.     database1.setConnection(new com.borland.dx.sql.dataset.ConnectionDescriptor("jdbc:microsoft:sqlserver://localhost:1433;databaseName=student", "sa", "sa", false, "com.microsoft.jdbc.sqlserver.SQLServerDriver"));
  180.     database1.setDatabaseName("");
  181.     jPanel6.setFont(new java.awt.Font("SansSerif", 0, 12));
  182.     jPanel6.setMinimumSize(new Dimension(50, 100));
  183.     jPanel6.setPreferredSize(new Dimension(50, 110));
  184.     jPanel6.setLayout(borderLayout3);
  185.     jPanel7.setFont(new java.awt.Font("SansSerif", 0, 12));
  186.     jPanel7.setMinimumSize(new Dimension(100, 30));
  187.     jPanel7.setPreferredSize(new Dimension(100, 40));
  188.     jPanel7.setLayout(flowLayout1);
  189.     jPanel8.setFont(new java.awt.Font("SansSerif", 0, 12));
  190.     jPanel8.setMinimumSize(new Dimension(10, 10));
  191.     jPanel8.setLayout(gridBagLayout2);
  192.     jLabel1.setText("学号:");
  193.     flowLayout1.setAlignment(FlowLayout.LEFT);
  194.     jLabel2.setHorizontalAlignment(SwingConstants.RIGHT);
  195.     jLabel2.setText("姓名:");
  196.     jLabel3.setHorizontalAlignment(SwingConstants.RIGHT);
  197.     jLabel3.setText("性别:");
  198.     jLabel4.setHorizontalAlignment(SwingConstants.RIGHT);
  199.     jLabel4.setText("班级:");
  200.     jLabel5.setHorizontalAlignment(SwingConstants.RIGHT);
  201.     jLabel5.setText("生日:");
  202.     jLabel6.setHorizontalAlignment(SwingConstants.RIGHT);
  203.     jLabel6.setText("电话:");
  204.     jLabel7.setHorizontalAlignment(SwingConstants.RIGHT);
  205.     jLabel7.setText("地址:");
  206.     jButton1.setText("修改");
  207.     jButton1.addActionListener(new MainFrame_jButton1_actionAdapter(this));
  208.     jButton2.setText("取消");
  209.    jdbTable1.setFont(new java.awt.Font("SansSerif", 0, 12));
  210.     jdbTable1.setDataSet(queryDataSet2);
  211.     jTabbedPane1.setFont(new java.awt.Font("SansSerif", 0, 12));
  212.     jTabbedPane1.setMinimumSize(new Dimension(500, 194));
  213.     jTabbedPane1.setPreferredSize(new Dimension(500, 607));
  214.     queryDataSet2.setProvider(null);
  215.     queryDataSet2.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(database1, "SELECT student_info.student_id,student_info.student_name,student_info.student_class,student_info.stud" +
  216.       "ent_sex,student_info.student_birthday,student_info.student_tel,student_info.student_address " +
  217.       "FROM student.dbo.student_info", null, true, Load.ALL));
  218.     column8.setCaption("生日");
  219.     column8.setColumnName("student_birthday");
  220.     column8.setDataType(com.borland.dx.dataset.Variant.TIMESTAMP);
  221.     column8.setDisplayMask("yyyy-MM-dd");
  222.     column8.setEditMask("yyyy-MM-dd");
  223.     column8.setSchemaName("dbo");
  224.     column8.setTableName("student_info");
  225.     column8.setWidth(10);
  226.     column8.setServerColumnName("student_birthday");
  227.     column8.setSqlType(93);
  228.     column9.setCaption("学号");
  229.     column9.setColumnName("student_id");
  230.     column9.setDataType(com.borland.dx.dataset.Variant.INT);
  231.     column9.setEditMask("######");
  232.     column9.setFont(new java.awt.Font("SansSerif", 0, 12));
  233.     column9.setRowId(true);
  234.     column9.setSchemaName("dbo");
  235.     column9.setTableName("student_info");
  236.     column9.setWidth(10);
  237.     column9.setServerColumnName("student_id");
  238.     column9.setSqlType(4);
  239.     column10.setCaption("姓名");
  240.     column10.setColumnName("student_name");
  241.     column10.setDataType(com.borland.dx.dataset.Variant.STRING);
  242.     column10.setPrecision(50);
  243.     column10.setSchemaName("dbo");
  244.     column10.setTableName("student_info");
  245.     column10.setWidth(10);
  246.     column10.setServerColumnName("student_name");
  247.     column10.setSqlType(12);
  248.     column11.setCaption("班级");
  249.     column11.setColumnName("student_class");
  250.     column11.setDataType(com.borland.dx.dataset.Variant.INT);
  251.     column11.setSchemaName("dbo");
  252.     column11.setTableName("student_info");
  253.     column11.setWidth(10);
  254.     column11.setServerColumnName("student_class");
  255.     column11.setSqlType(4);
  256.     column12.setCaption("性别");
  257.     column12.setColumnName("student_sex");
  258.     column12.setDataType(com.borland.dx.dataset.Variant.STRING);
  259.     column12.setPrecision(50);
  260.     column12.setSchemaName("dbo");
  261.     column12.setTableName("student_info");
  262.     column12.setWidth(10);
  263.     column12.setServerColumnName("student_sex");
  264.     column12.setSqlType(12);
  265.     column13.setCaption("联系电话");
  266.     column13.setColumnName("student_tel");
  267.     column13.setDataType(com.borland.dx.dataset.Variant.STRING);
  268.     column13.setPrecision(50);
  269.     column13.setSchemaName("dbo");
  270.     column13.setTableName("student_info");
  271.     column13.setWidth(10);
  272.     column13.setServerColumnName("student_tel");
  273.     column13.setSqlType(12);
  274.     column14.setCaption("联系地址");
  275.     column14.setColumnName("student_address");
  276.     column14.setDataType(com.borland.dx.dataset.Variant.STRING);
  277.     column14.setPrecision(150);
  278.     column14.setSchemaName("dbo");
  279.     column14.setTableName("student_info");
  280.     column14.setWidth(14);
  281.     column14.setServerColumnName("student_address");
  282.     column14.setSqlType(12);
  283.     queryDataSet2.setColumns(new Column[] {column9, column10, column11, column12, column8, column13, column14});
  284.     queryDataSet2.addNavigationListener(new MainFrame_queryDataSet2_navigationAdapter(this));
  285.     jPanel1.setFont(new java.awt.Font("SansSerif", 0, 12));
  286.     jPanel1.setPreferredSize(new Dimension(472, 580));
  287.     jPanel5.setFont(new java.awt.Font("SansSerif", 0, 12));
  288.     tableScrollPane1.setFont(new java.awt.Font("SansSerif", 0, 12));
  289.     tableScrollPane1.getViewport().setFont(new java.awt.Font("SansSerif", 0, 12));
  290.     this.setFont(new java.awt.Font("SansSerif", 0, 12));
  291.     jPanel2.setFont(new java.awt.Font("SansSerif", 0, 12));
  292.     jPanel2.setLayout(borderLayout4);
  293.     jLabel8.setText("学号:");
  294.     jLabel9.setRequestFocusEnabled(true);
  295.     jLabel9.setText("姓名: ");
  296.     jLabel10.setText("班级: ");
  297.     jLabel11.setText("性别: ");
  298.     jdbNavToolBar2.setEnabled(false);
  299.     jdbNavToolBar2.setAlignment(FlowLayout.CENTER);
  300.     jPanel10.setMinimumSize(new Dimension(300, 10));
  301.     jPanel10.setPreferredSize(new Dimension(300, 10));
  302.     jPanel10.setLayout(borderLayout5);
  303.     jLabel12.setText("学校设置可选课程信息");
  304.     jPanel11.setMinimumSize(new Dimension(200, 10));
  305.     jPanel11.setPreferredSize(new Dimension(200, 10));
  306.     jPanel11.setLayout(borderLayout6);
  307.     jLabel13.setText("个人已选课程信息");
  308.     jButton3.setText("选课");
  309.     jButton3.addActionListener(new MainFrame_jButton3_actionAdapter(this));
  310.     jButton4.setText("退课");
  311.     jButton4.addActionListener(new MainFrame_jButton4_actionAdapter(this));
  312.     jPanel12.setLayout(xYLayout1);
  313.     queryDataSet1.setReadOnly(false);
  314.     queryDataSet1.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(database1, "SELECT student_coursecode.course_code,student_coursecode.course_name,student_coursecode.course_period" +
  315.       ",student_coursecode.course_credit,student_coursecode.course_teacher,student_coursecode.course_address" +
  316.       " FROM student.dbo.student_coursecode", null, true, Load.ALL));
  317.     column1.setCaption("课程代号");
  318.     column1.setColumnName("course_code");
  319.     column1.setDataType(com.borland.dx.dataset.Variant.INT);
  320.     column1.setRowId(true);
  321.     column1.setSchemaName("dbo");
  322.     column1.setTableName("student_coursecode");
  323.     column1.setWidth(10);
  324.     column1.setServerColumnName("course_code");
  325.     column1.setSqlType(4);
  326.     column2.setCaption("课程名称");
  327.     column2.setColumnName("course_name");
  328.     column2.setDataType(com.borland.dx.dataset.Variant.STRING);
  329.     column2.setPrecision(50);
  330.     column2.setSchemaName("dbo");
  331.     column2.setTableName("student_coursecode");
  332.     column2.setWidth(10);
  333.     column2.setServerColumnName("course_name");
  334.     column2.setSqlType(12);
  335.     column3.setCaption("课程学时");
  336.     column3.setColumnName("course_period");
  337.     column3.setDataType(com.borland.dx.dataset.Variant.INT);
  338.     column3.setSchemaName("dbo");
  339.     column3.setTableName("student_coursecode");
  340.     column3.setWidth(10);
  341.     column3.setServerColumnName("course_period");
  342.     column3.setSqlType(4);
  343.     column4.setCaption("课程学分");
  344.     column4.setColumnName("course_credit");
  345.     column4.setDataType(com.borland.dx.dataset.Variant.DOUBLE);
  346.     column4.setSchemaName("dbo");
  347.     column4.setTableName("student_coursecode");
  348.     column4.setWidth(10);
  349.     column4.setServerColumnName("course_credit");
  350.     column4.setSqlType(6);
  351.     column5.setCaption("任课老师");
  352.     column5.setColumnName("course_teacher");
  353.     column5.setDataType(com.borland.dx.dataset.Variant.STRING);
  354.     column5.setPrecision(50);
  355.     column5.setSchemaName("dbo");
  356.     column5.setTableName("student_coursecode");
  357.     column5.setWidth(10);
  358.     column5.setServerColumnName("course_teacher");
  359.     column5.setSqlType(12);
  360.     column6.setCaption("上课地点");
  361.     column6.setColumnName("course_address");
  362.     column6.setDataType(com.borland.dx.dataset.Variant.STRING);
  363.     column6.setPrecision(50);
  364.     column6.setSchemaName("dbo");
  365.     column6.setTableName("student_coursecode");
  366.     column6.setWidth(10);
  367.     column6.setServerColumnName("course_address");
  368.     column6.setSqlType(12);
  369.     queryDataSet1.setColumns(new Column[] {column1, column2, column3, column4, column5, column6});
  370.     jdbTable2.setDataSet(queryDataSet1);
  371.     jdbTable2.setEditable(false);
  372.     column7.setCaption("学生姓名");
  373.     column7.setColumnName("course_name");
  374.     column7.setDataType(com.borland.dx.dataset.Variant.STRING);
  375.     column7.setPrecision(50);
  376.     column7.setSchemaName("dbo");
  377.     column7.setTableName("student_course");
  378.     column7.setWidth(10);
  379.     column7.setServerColumnName("course_name");
  380.     column7.setSqlType(12);
  381.     jLabel14.setText("学号:");
  382.     jLabel15.setText("性别: ");
  383.     jLabel16.setRequestFocusEnabled(true);
  384.     jLabel16.setText("姓名: ");
  385.     jLabel17.setText("班级: ");
  386.     jPanel3.setLayout(borderLayout7);
  387.     jPanel15.setMinimumSize(new Dimension(200, 100));
  388.     jPanel15.setPreferredSize(new Dimension(200, 250));
  389.     jPanel15.setLayout(borderLayout8);
  390.     jPanel14.setLayout(borderLayout9);
  391.     jPanel14.setMinimumSize(new Dimension(300, 50));
  392.     jPanel14.setPreferredSize(new Dimension(300, 50));
  393.     jPanel14.setVerifyInputWhenFocusTarget(true);
  394.     jPanel13.setPreferredSize(new Dimension(404, 40));
  395.     jPanel16.setPreferredSize(new Dimension(280, 10));
  396.     jPanel16.setLayout(gridBagLayout1);
  397.     jLabel18.setText("获奖时间:");
  398.     jLabel19.setText("获奖名称:");
  399.     jdbTextField1.setText("jdbTextField1");     jdbTextField1.setColumnName("gcheck_time");     jdbTextField1.setDataSet(qSet_jiangli);
  400.     jdbTextField2.setText("jdbTextField2");     jdbTextField2.setColumnName("gcheck_title");     jdbTextField2.setDataSet(qSet_jiangli);
  401.     jdbTextArea1.setText("jdbTextArea1");     jdbTextArea1.setColumnName("gcheck_disc");     jdbTextArea1.setDataSet(qSet_jiangli);
  402.     jPanel17.setLayout(borderLayout10);
  403.     jButton5.setText("增加");
  404.     jButton6.setText("取消");
  405.     jPanel18.setLayout(borderLayout11);
  406.     borderLayout11.setVgap(10);
  407.     jLabel20.setText("获奖内容具体描述:");
  408.     jdbTextField3.setEnabled(true);
  409.     jdbTextField3.setAlignmentX((float) 0.5);
  410.     jdbTextField3.setDoubleBuffered(false);
  411.     jdbTextField3.setMinimumSize(new Dimension(10, 22));
  412.     jdbTextField3.setPreferredSize(new Dimension(15, 22));
  413.     jdbTextField3.setMargin(new Insets(1, 3, 1, 3));
  414.     jdbTextField3.setText("");
  415.     jdbTextField3.setHorizontalAlignment(SwingConstants.LEFT);
  416.     jdbTextField3.setColumnName("student_name");
  417.     jdbTextField3.setDataSet(queryDataSet2);
  418.     jdbTextField3.setEnablePopupMenu(true);
  419.     jdbTextField3.setPostOnFocusLost(true);
  420.     jdbTextField4.setDebugGraphicsOptions(0);
  421.     jdbTextField4.setText("jdbTextField4");
  422.     jdbTextField4.setColumnName("student_class");
  423.     jdbTextField4.setDataSet(queryDataSet2);
  424.     jdbTextField5.setText("jdbTextField5");
  425.     jdbTextField5.setColumnName("student_tel");
  426.     jdbTextField5.setDataSet(queryDataSet2);
  427.     jdbTextField7.setDisabledTextColor(Color.gray);
  428.     jdbTextField7.setText("jdbTextField7");
  429.     jdbTextField7.setColumnName("student_birthday");
  430.     jdbTextField7.setDataSet(queryDataSet2);
  431.     jdbTextField8.setText("jdbTextField8");
  432.     jdbTextField8.setColumnName("student_address");
  433.     jdbTextField8.setDataSet(queryDataSet2);
  434.     jdbRadioButton2.setSelected(false);
  435.     jdbRadioButton2.setText("女");
  436.     jdbRadioButton2.setButtonGroup(buttonGroup1);
  437.     jdbRadioButton2.setColumnName("student_sex");
  438.     jdbRadioButton2.setDataSet(queryDataSet2);
  439.     jdbRadioButton2.setSelectedDataValue("女");
  440.     jdbRadioButton1.setActionCommand("男");
  441.     jdbRadioButton1.setContentAreaFilled(true);
  442.     jdbRadioButton1.setSelected(true);
  443.     jdbRadioButton1.setText("男");
  444.     jdbRadioButton1.setButtonGroup(buttonGroup1);
  445.     jdbRadioButton1.setColumnName("student_sex");
  446.     jdbRadioButton1.setDataSet(queryDataSet2);
  447.     jdbRadioButton1.setSelectedDataValue("男");
  448.     jdbNavField1.setMinimumSize(new Dimension(100, 22));
  449.     jdbNavField1.setPreferredSize(new Dimension(100, 22));
  450.     jdbNavField1.setText("jdbNavField1");
  451.     jdbNavField1.setColumnName("student_id");
  452.     jdbNavField1.setDataSet(queryDataSet2);
  453.     jdbTextField9.setEnabled(true);
  454.     jdbTextField9.setPreferredSize(new Dimension(70, 22));
  455.     jdbTextField9.setEditable(false);
  456.     jdbTextField9.setText("jdbTextField9");
  457.     jdbTextField9.setColumns(0);
  458.     jdbTextField9.setColumnName("student_class");
  459.     jdbTextField9.setDataSet(queryDataSet2);
  460.     jdbTextField10.setEnabled(true);
  461.     jdbTextField10.setPreferredSize(new Dimension(50, 22));
  462.     jdbTextField10.setEditable(false);
  463.     jdbTextField10.setText("jdbTextField10");
  464.     jdbTextField10.setColumnName("student_sex");
  465.     jdbTextField10.setDataSet(queryDataSet2);
  466.     queryDataSet4.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(database1, "SELECT student_count.count_id FROM student.dbo.student_count", null, true, Load.ALL));
  467.     qSet_course.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(database1, "SELECT student_course.count_id,student_course.course_id,student_course.course_name,student_course.cou" +
  468.       "rse_no FROM student.dbo.student_course", null, true, Load.ALL));
  469.     column15.setColumnName("count_id");
  470.     column15.setDataType(com.borland.dx.dataset.Variant.INT);
  471.     column15.setRowId(true);
  472.     column15.setSchemaName("dbo");
  473.     column15.setTableName("student_course");
  474.     column15.setVisible(com.borland.jb.util.TriStateProperty.FALSE);
  475.     column15.setServerColumnName("count_id");
  476.     column15.setSqlType(4);
  477.     column16.setColumnName("course_id");
  478.     column16.setDataType(com.borland.dx.dataset.Variant.INT);
  479.     column16.setSchemaName("dbo");
  480.     column16.setTableName("student_course");
  481.     column16.setVisible(com.borland.jb.util.TriStateProperty.FALSE);
  482.     column16.setServerColumnName("course_id");
  483.     column16.setSqlType(4);
  484.     column18.setCaption("学生姓名");
  485.     column18.setColumnName("course_name");
  486.     column18.setDataType(com.borland.dx.dataset.Variant.STRING);
  487.     column18.setPrecision(50);
  488.     column18.setSchemaName("dbo");
  489.     column18.setTableName("student_course");
  490.     column18.setWidth(10);
  491.     column18.setServerColumnName("course_name");
  492.     column18.setSqlType(12);
  493.     column19.setCaption("所选课程编号");
  494.     column19.setColumnName("course_no");
  495.     column19.setDataType(com.borland.dx.dataset.Variant.INT);
  496.     column19.setSchemaName("dbo");
  497.     column19.setTableName("student_course");
  498.     column19.setServerColumnName("course_no");
  499.     column19.setSqlType(4);
  500.     qSet_course.setColumns(new Column[] {column15, column16, column18, column19});
  501.     qSet_course.addRowFilterListener(new MainFrame_qSet_course_rowFilterAdapter(this));
  502.     jdbTable3.setDataSet(qSet_course);
  503.     jdbTextField11.setMinimumSize(new Dimension(70, 22));
  504.     jdbTextField11.setPreferredSize(new Dimension(70, 22));
  505.     jdbTextField11.setEditable(false);
  506.     jdbTextField11.setText("jdbTextField11");
  507.     jdbTextField11.setColumnName("student_name");
  508.     jdbTextField11.setDataSet(queryDataSet2);
  509.     jdbNavField2.setDataSet(queryDataSet2);
  510.     jdbNavField2.setColumnName("student_id");
  511.     jdbNavField2.setPreferredSize(new Dimension(70, 22));
  512.     jdbNavField2.setMinimumSize(new Dimension(70, 22));
  513.     jdbNavField3.setMinimumSize(new Dimension(70, 22));
  514.     jdbNavField3.setPreferredSize(new Dimension(70, 22));
  515.     jdbNavField3.setColumnName("student_id");
  516.     jdbNavField3.setDataSet(queryDataSet2);
  517.     jdbTextField12.setDataSet(queryDataSet2);
  518.     jdbTextField12.setColumnName("student_name");
  519.     jdbTextField12.setText("jdbTextField11");
  520.     jdbTextField12.setEditable(false);
  521.     jdbTextField12.setPreferredSize(new Dimension(70, 22));
  522.     jdbTextField12.setMinimumSize(new Dimension(70, 22));
  523.     jdbTextField13.setDataSet(queryDataSet2);
  524.     jdbTextField13.setColumnName("student_class");
  525.     jdbTextField13.setColumns(0);
  526.     jdbTextField13.setText("jdbTextField9");
  527.     jdbTextField13.setEditable(false);
  528.     jdbTextField13.setPreferredSize(new Dimension(70, 22));
  529.     jdbTextField13.setEnabled(true);
  530.     jdbTextField14.setDataSet(queryDataSet2);
  531.     jdbTextField14.setColumnName("student_sex");
  532.     jdbTextField14.setText("jdbTextField10");
  533.     jdbTextField14.setEditable(false);
  534.     jdbTextField14.setPreferredSize(new Dimension(50, 22));
  535.     jdbTextField14.setEnabled(true);
  536.     qSet_jiangli.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(database1, "SELECT student_gcheck.gcheck_id,student_gcheck.gcheck_no,student_gcheck.gcheck_name,student_gcheck.gc" +
  537.       "heck_time,student_gcheck.gcheck_title,student_gcheck.gcheck_disc " +
  538.       "FROM student.dbo.student_gcheck", null, true, Load.ALL));
  539.     column17.setColumnName("gcheck_time");
  540.     column17.setDataType(com.borland.dx.dataset.Variant.TIMESTAMP);
  541.     column17.setEditMask("yyyy-MM-dd");
  542.     column17.setSchemaName("dbo");
  543.     column17.setTableName("student_gcheck");
  544.     column17.setServerColumnName("gcheck_time");
  545.     column17.setSqlType(93);
  546.     column20.setCaption("获奖时间");     column20.setColumnName("gcheck_time");     column20.setDataType(com.borland.dx.dataset.Variant.TIMESTAMP);     column20.setEditMask("yyyy-MM-dd");     column20.setSchemaName("dbo");     column20.setTableName("student_gcheck");     column20.setServerColumnName("gcheck_time");     column20.setSqlType(93);     jdbTable4.setDataSet(qSet_jiangli);     column21.setColumnName("gcheck_id");     column21.setDataType(com.borland.dx.dataset.Variant.INT);     column21.setRowId(true);     column21.setSchemaName("dbo");     column21.setTableName("student_gcheck");     column21.setVisible(com.borland.jb.util.TriStateProperty.FALSE);     column21.setServerColumnName("gcheck_id");     column21.setSqlType(4);     column22.setColumnName("gcheck_no");     column22.setDataType(com.borland.dx.dataset.Variant.INT);     column22.setSchemaName("dbo");     column22.setTableName("student_gcheck");     column22.setVisible(com.borland.jb.util.TriStateProperty.FALSE);     column22.setServerColumnName("gcheck_no");     column22.setSqlType(4);     column23.setColumnName("gcheck_name");     column23.setDataType(com.borland.dx.dataset.Variant.STRING);     column23.setPrecision(10);     column23.setSchemaName("dbo");     column23.setTableName("student_gcheck");     column23.setVisible(com.borland.jb.util.TriStateProperty.FALSE);     column23.setServerColumnName("gcheck_name");     column23.setSqlType(1);     column24.setCaption("获奖名称");     column24.setColumnName("gcheck_title");     column24.setDataType(com.borland.dx.dataset.Variant.STRING);     column24.setPrecision(50);     column24.setSchemaName("dbo");     column24.setTableName("student_gcheck");     column24.setWidth(10);     column24.setServerColumnName("gcheck_title");     column24.setSqlType(12);     column25.setCaption("具体说明");     column25.setColumnName("gcheck_disc");     column25.setDataType(com.borland.dx.dataset.Variant.STRING);     column25.setPrecision(50);     column25.setSchemaName("dbo");     column25.setTableName("student_gcheck");     column25.setWidth(20);     column25.setServerColumnName("gcheck_disc");     column25.setSqlType(12);     qSet_jiangli.setColumns(new Column[] {column21, column22, column23, column20, column24, column25});     this.getContentPane().add(jTabbedPane1,
  547.                               new PaneConstraints("jTabbedPane1", "jTabbedPane1",
  548.                                                   PaneConstraints.ROOT, 1.0f));
  549.     jTabbedPane1.add(jPanel1, "个人信息管理");
  550.     jPanel1.add(jPanel5, BorderLayout.CENTER);
  551.     jPanel5.add(jdbNavToolBar1, BorderLayout.SOUTH);
  552.     jPanel5.add(jPanel6, BorderLayout.NORTH);
  553.     jPanel6.add(jPanel7, BorderLayout.NORTH);
  554.     jPanel7.add(jLabel1, null);
  555.     jPanel6.add(jPanel8, BorderLayout.CENTER);
  556.     jPanel8.add(jLabel2,    new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0
  557.             ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 28, 19));
  558.     jPanel8.add(jdbTextField3,      new GridBagConstraints(1, 0, 2, 1, 1.0, 0.0
  559.             ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 75, 13));
  560.     jPanel8.add(jLabel4,     new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0
  561.             ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 31, 19));
  562.     jPanel8.add(jdbTextField4,   new GridBagConstraints(4, 0, 1, 1, 1.0, 0.0
  563.             ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 57, 13));
  564.     jPanel8.add(jLabel6,   new GridBagConstraints(5, 0, 1, 1, 0.0, 0.0
  565.             ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 40, 19));
  566.     jPanel8.add(jdbTextField5,   new GridBagConstraints(6, 0, 1, 1, 1.0, 0.0
  567.             ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 57, 13));
  568.     jPanel8.add(jButton1,   new GridBagConstraints(7, 0, 1, 1, 0.0, 0.0
  569.             ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 3), 16, 10));
  570.     jPanel8.add(jLabel3,    new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0
  571.             ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 30, 19));
  572.     jPanel8.add(jPanel19,     new GridBagConstraints(2, 1, 1, 1, 1.0, 1.0
  573.             ,GridBagConstraints.CENTER, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), -3, 25));
  574.     jPanel8.add(jLabel5,            new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0
  575.             ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 1), 30, 19));
  576.     jPanel8.add(jdbTextField7,   new GridBagConstraints(4, 1, 1, 1, 1.0, 0.0
  577.             ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 7, 13));
  578.     jPanel8.add(jLabel7,   new GridBagConstraints(5, 1, 1, 1, 0.0, 0.0
  579.             ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 40, 19));
  580.     jPanel8.add(jdbTextField8,   new GridBagConstraints(6, 1, 1, 1, 1.0, 0.0
  581.             ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 57, 13));
  582.     jPanel8.add(jButton2,   new GridBagConstraints(7, 1, 1, 1, 0.0, 0.0
  583.             ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 3), 16, 10));
  584.     jPanel5.add(tableScrollPane1, BorderLayout.CENTER);
  585.     tableScrollPane1.getViewport().add(jdbTable1, null);
  586.     jTabbedPane1.add(jPanel2, "选课信息管理");
  587.     jTabbedPane1.add(jPanel3, "奖励信息管理");
  588.     jPanel3.add(jPanel13, BorderLayout.NORTH);
  589.     jPanel13.add(jLabel14, null);     jPanel13.add(jdbNavField3, null);
  590.     jPanel13.add(jLabel16, null);     jPanel13.add(jdbTextField12, null);
  591.     jPanel13.add(jLabel17, null);     jPanel13.add(jdbTextField13, null);
  592.     jPanel13.add(jLabel15, null);
  593.     jPanel3.add(jPanel15,  BorderLayout.SOUTH);
  594.     jPanel15.add(tableScrollPane4, BorderLayout.CENTER);
  595.     tableScrollPane4.getViewport().add(jdbTable4, null);
  596.     jPanel3.add(jPanel14, BorderLayout.CENTER);
  597.     jPanel14.add(jPanel16, BorderLayout.WEST);
  598.     jPanel16.add(jLabel18,  new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0
  599.             ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 17, 14));
  600.     jPanel16.add(jLabel19,  new GridBagConstraints(0, 1, 1, 2, 0.0, 0.0
  601.             ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 13, 10));
  602.     jPanel16.add(jdbTextField1,   new GridBagConstraints(1, 0, 2, 1, 0.0, 0.0             ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 89, 2));
  603.     jPanel16.add(jdbTextField2,        new GridBagConstraints(1, 2, 3, 2, 0.0, 0.0             ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 91, 0));
  604.     jPanel14.add(jPanel17, BorderLayout.CENTER);
  605.     jPanel17.add(jdbTextArea1, BorderLayout.CENTER);
  606.     jPanel17.add(jLabel20, BorderLayout.NORTH);
  607.     jPanel14.add(jPanel18,  BorderLayout.EAST);
  608.     jPanel18.add(jButton5,  BorderLayout.NORTH);
  609.     jPanel18.add(jButton6, BorderLayout.CENTER);
  610.     jTabbedPane1.add(jPanel4, "职务信息管理");
  611.     jPanel2.add(jPanel9, BorderLayout.NORTH);
  612.     jPanel9.add(jLabel8, null);
  613.     jPanel9.add(jdbNavField2, null);
  614.     jPanel9.add(jLabel9, null);
  615.     jPanel9.add(jdbTextField11, null);
  616.     jPanel9.add(jLabel10, null);
  617.     jPanel9.add(jdbTextField9, null);
  618.     jPanel9.add(jLabel11, null);
  619.     jPanel9.add(jdbTextField10, null);
  620.     jPanel2.add(jdbNavToolBar2, BorderLayout.SOUTH);
  621.     jPanel2.add(jPanel10, BorderLayout.WEST);
  622.     jPanel10.add(jLabel12, BorderLayout.NORTH);
  623.     jPanel10.add(tableScrollPane2, BorderLayout.CENTER);
  624.     tableScrollPane2.getViewport().add(jdbTable2, null);
  625.     jPanel2.add(jPanel11, BorderLayout.EAST);
  626.     jPanel11.add(jLabel13, BorderLayout.NORTH);
  627.     jPanel11.add(tableScrollPane3, BorderLayout.CENTER);
  628.     tableScrollPane3.getViewport().add(jdbTable3, null);
  629.     jPanel2.add(jPanel12, BorderLayout.CENTER);
  630.     jPanel12.add(jButton3, new XYConstraints(4, 89, -1, 31));
  631.     jPanel12.add(jButton4, new XYConstraints(2, 153, 59, 33));
  632.     jPanel19.add(jdbRadioButton1, null);
  633.     jPanel19.add(jdbRadioButton2, null);
  634.     buttonGroup1.add(jdbRadioButton2);
  635.     buttonGroup1.add(jdbRadioButton1);
  636.     jPanel7.add(jdbNavField1, null);
  637.     jPanel13.add(jdbTextField14, null);
  638.   }
  639.   void jButton1_actionPerformed(ActionEvent e) {
  640.     queryDataSet2.saveChanges();
  641.   }
  642.   void jButton3_actionPerformed(ActionEvent e) {
  643.     if ( queryDataSet2.isEmpty() ) return;
  644.     if ( queryDataSet1.isEmpty() ) return;
  645.     if (!queryDataSet4.isOpen()) queryDataSet4.open();
  646.     queryDataSet4.last();
  647.       int i = queryDataSet4.getInt("count_id");
  648.     queryDataSet4.setInt("count_id", ++i);
  649.     queryDataSet4.post();
  650.     queryDataSet4.saveChanges( queryDataSet4 );
  651.     if (! qSet_course.isOpen() ) qSet_course.open();
  652.     try {
  653.       qSet_course.insertRow(false);
  654.       qSet_course.setInt("count_id", i);
  655.       qSet_course.setInt("course_id", queryDataSet2.getInt("student_id"));
  656.       qSet_course.setString("course_name",
  657.                             queryDataSet2.getString("student_name"));
  658.       qSet_course.setInt("course_no", queryDataSet1.getInt("course_code"));
  659.       qSet_course.post();
  660.       qSet_course.saveChanges(qSet_course);
  661.     }catch (Exception ex ){
  662.         qSet_course.refresh();
  663.     }
  664.   }
  665.   void jButton4_actionPerformed(ActionEvent e) {
  666.     if (! qSet_course.isOpen() ) qSet_course.open();
  667.     if ( qSet_course.isEmpty() ) return;
  668.     qSet_course.deleteRow();
  669.     qSet_course.saveChanges( qSet_course );
  670.   }
  671.   void qSet_course_filterRow(ReadRow row, RowFilterResponse response) {
  672.     if ( row.getInt("course_id" )== queryDataSet2.getInt("student_id") )
  673.     {
  674.       response.add();
  675.     }else{
  676.       response.ignore();
  677.     }
  678.   }
  679.   void queryDataSet2_masterNavigating(MasterNavigateEvent e) {
  680.   }
  681.   void jPanel2_focusGained(FocusEvent e) {
  682.     qSet_course.refilter();
  683.   }
  684.   void queryDataSet2_navigated(NavigationEvent e) {
  685.     qSet_course.refilter();
  686.   }
  687. }
  688. class MainFrame_jButton1_actionAdapter implements java.awt.event.ActionListener {
  689.   MainFrame adaptee;
  690.   MainFrame_jButton1_actionAdapter(MainFrame adaptee) {
  691.     this.adaptee = adaptee;
  692.   }
  693.   public void actionPerformed(ActionEvent e) {
  694.     adaptee.jButton1_actionPerformed(e);
  695.   }
  696. }
  697. class MainFrame_jButton3_actionAdapter implements java.awt.event.ActionListener {
  698.   MainFrame adaptee;
  699.   MainFrame_jButton3_actionAdapter(MainFrame adaptee) {
  700.     this.adaptee = adaptee;
  701.   }
  702.   public void actionPerformed(ActionEvent e) {
  703.     adaptee.jButton3_actionPerformed(e);
  704.   }
  705. }
  706. class MainFrame_jButton4_actionAdapter implements java.awt.event.ActionListener {
  707.   MainFrame adaptee;
  708.   MainFrame_jButton4_actionAdapter(MainFrame adaptee) {
  709.     this.adaptee = adaptee;
  710.   }
  711.   public void actionPerformed(ActionEvent e) {
  712.     adaptee.jButton4_actionPerformed(e);
  713.   }
  714. }
  715. class MainFrame_qSet_course_rowFilterAdapter implements com.borland.dx.dataset.RowFilterListener {
  716.   MainFrame adaptee;
  717.   MainFrame_qSet_course_rowFilterAdapter(MainFrame adaptee) {
  718.     this.adaptee = adaptee;
  719.   }
  720.   public void filterRow(ReadRow row, RowFilterResponse response) {
  721.     adaptee.qSet_course_filterRow(row, response);
  722.   }
  723. }
  724. class MainFrame_queryDataSet2_navigationAdapter implements com.borland.dx.dataset.NavigationListener {
  725.   MainFrame adaptee;
  726.   MainFrame_queryDataSet2_navigationAdapter(MainFrame adaptee) {
  727.     this.adaptee = adaptee;
  728.   }
  729.   public void navigated(NavigationEvent e) {
  730.     adaptee.queryDataSet2_navigated(e);
  731.   }
  732. }