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