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

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