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

Java编程

开发平台:

Java

  1. package manpowersystem;
  2. /**
  3.  * <p>Title: </p>
  4.  * <p>Description: </p>
  5.  * <p>Copyright: Copyright (c) 2003</p>
  6.  * <p>Company: </p>
  7.  * @author not attributable
  8.  * @version 1.0
  9.  */
  10. import java.io.*;
  11. import java.util.*;
  12. import java.awt.*;
  13. import java.awt.event.*;
  14. import javax.swing.*;
  15. import javax.swing.event.*;
  16. import javax.swing.border.*;
  17. import javax.swing.table.*;
  18. import com.borland.jbcl.layout.*;
  19. public class TablePanel extends JFrame {
  20.     Database database = new Database(); //数据可存取对象
  21.     RecordItem item = new RecordItem();
  22.     Object[][] arrData = {};      //设定表格的字段
  23.     DefaultTableModel tableModel; //表格模型
  24.     int intDelLines;         //显示所选的行数
  25.     boolean bCanDel = true;  //是否可以删除
  26.     int intEmploreeID;       //员工工号
  27.     String strName;          //员工姓名
  28.     Date dateTime;           //确切记录
  29.     String strDescribe;      //备注
  30.     JTable jRecordTable;
  31.     XYLayout xYLayout1 = new XYLayout();
  32.     JButton jAddRecordButton = new JButton();
  33.     JButton jDelRecordButton = new JButton();
  34.     JButton jExitButton = new JButton();
  35.     JScrollPane jTableScrollPane = new JScrollPane();
  36.     public TablePanel() {
  37.         try {
  38.             jbInit();
  39.         }
  40.         catch ( Exception e ) {
  41.             e.printStackTrace();
  42.         }
  43.     }
  44.     public static void main( String[] args ) {
  45.         TablePanel tablePanel1 = new TablePanel();
  46.         //tablePanel1.setSize(600,400);
  47.         tablePanel1.validate();
  48.         tablePanel1.setVisible( true );
  49.     }
  50.     private void jbInit() throws Exception {
  51.         this.getContentPane().setBackground( new Color( 210, 138, 177 ) );
  52.         this.getContentPane().setLayout( xYLayout1 );
  53.         jAddRecordButton.setBackground( new Color( 212, 158, 217 ) );
  54.         jAddRecordButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
  55.         jAddRecordButton.setText( "添加记录" );
  56.         jAddRecordButton.addActionListener( new java.awt.event.ActionListener() {
  57.             public void actionPerformed( ActionEvent e ) {
  58.                 jAddRecordButton_actionPerformed( e );
  59.             }
  60.         } );
  61.         jDelRecordButton.setBackground( new Color( 212, 158, 217 ) );
  62.         jDelRecordButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
  63.         jDelRecordButton.setText( "删除记录" );
  64.         jDelRecordButton.addActionListener( new java.awt.event.ActionListener() {
  65.             public void actionPerformed( ActionEvent e ) {
  66.                 jDelRecordButton_actionPerformed( e );
  67.             }
  68.         } );
  69.         jExitButton.setBackground( new Color( 212, 158, 217 ) );
  70.         jExitButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
  71.         jExitButton.setText( "退出" );
  72.         jExitButton.addActionListener( new java.awt.event.ActionListener() {
  73.             public void actionPerformed( ActionEvent e ) {
  74.                 jExitButton_actionPerformed( e );
  75.             }
  76.         } );
  77.         addWindowListener( new WindowAdapter() {
  78.             public void windowClosing( WindowEvent e ) {
  79.                 dispose();
  80.             }
  81.         } );
  82.         jTableScrollPane.getViewport().setBackground( new Color( 210, 138, 177 ) );
  83.         this.getContentPane().add( jAddRecordButton,
  84.                                    new XYConstraints( 32, 448, 102, 52 ) );
  85.         this.getContentPane().add( jDelRecordButton,
  86.                                    new XYConstraints( 180, 447, 102, 52 ) );
  87.         this.getContentPane().add( jExitButton,
  88.                                    new XYConstraints( 329, 448, 102, 52 ) );
  89.         this.getContentPane().add( jTableScrollPane,
  90.                                    new XYConstraints( 3, 3, 458, 421 ) );
  91.         jTableScrollPane.getViewport().add( jRecordTable, null );
  92.         this.setSize( 470, 550 );
  93.         this.setLocation( 230, 100 );
  94.         this.setVisible(true);
  95.         this.setResizable( false );
  96.     }
  97.     void jExitButton_actionPerformed( ActionEvent e ) {
  98.         this.dispose();
  99.     }
  100.     void jAddRecordButton_actionPerformed( ActionEvent e ) {
  101.         AddRecord();
  102.     }
  103.     void jDelRecordButton_actionPerformed( ActionEvent e ) {
  104.         DelRecord();
  105.     }
  106.     public void AddRecord() {
  107.     }
  108.     public void DelRecord() {
  109.     }
  110.     public void UpdateRecord() {
  111.     }
  112. }