TablePanel.java~86~
资源名称:Java.rar [点击查看]
上传用户:liming9091
上传日期:2014-10-27
资源大小:3376k
文件大小:4k
源码类别:
Java编程
开发平台:
Java
- package manpowersystem;
- /**
- * <p>Title: </p>
- * <p>Description: </p>
- * <p>Copyright: Copyright (c) 2003</p>
- * <p>Company: </p>
- * @author not attributable
- * @version 1.0
- */
- import java.io.*;
- import java.util.*;
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- import javax.swing.event.*;
- import javax.swing.border.*;
- import javax.swing.table.*;
- import com.borland.jbcl.layout.*;
- public class TablePanel extends JFrame {
- Database database = new Database(); //数据库存取对象
- RecordItem item = new RecordItem(); //每一条数据记录
- Object[][] arrData = {}; //设定表格的字段
- DefaultTableModel tableModel; //表格模型
- int intRow; //显示所选的行数
- int intCol; //显示所选的行数
- boolean bCanDel = true; //是否可以删除
- int intEmploreeID; //员工工号
- String strName; //员工姓名
- Date dateTime; //确切记录
- String strDescribe; //备注
- JTable jRecordTable;
- XYLayout xYLayout1 = new XYLayout();
- JButton jAddRecordButton = new JButton();
- JButton jDelRecordButton = new JButton();
- JButton jExitButton = new JButton();
- JScrollPane jTableScrollPane = new JScrollPane();
- public TablePanel() {
- try {
- jbInit();
- }
- catch ( Exception e ) {
- e.printStackTrace();
- }
- }
- public static void main( String[] args ) {
- TablePanel tablePanel1 = new TablePanel();
- tablePanel1.validate();
- tablePanel1.setVisible( true );
- }
- private void jbInit() throws Exception {
- this.getContentPane().setBackground( new Color( 210, 138, 177 ) );
- this.getContentPane().setLayout( xYLayout1 );
- jAddRecordButton.setBackground( new Color( 212, 158, 217 ) );
- jAddRecordButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
- jAddRecordButton.setText( "添加记录" );
- jAddRecordButton.addActionListener( new java.awt.event.ActionListener() {
- public void actionPerformed( ActionEvent e ) {
- jAddRecordButton_actionPerformed( e );
- }
- } );
- jDelRecordButton.setBackground( new Color( 212, 158, 217 ) );
- jDelRecordButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
- jDelRecordButton.setText( "删除记录" );
- jDelRecordButton.addActionListener( new java.awt.event.ActionListener() {
- public void actionPerformed( ActionEvent e ) {
- jDelRecordButton_actionPerformed( e );
- }
- } );
- jExitButton.setBackground( new Color( 212, 158, 217 ) );
- jExitButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
- jExitButton.setText( "退出" );
- jExitButton.addActionListener( new java.awt.event.ActionListener() {
- public void actionPerformed( ActionEvent e ) {
- jExitButton_actionPerformed( e );
- }
- } );
- addWindowListener( new WindowAdapter() {
- public void windowClosing( WindowEvent e ) {
- dispose();
- }
- } );
- jTableScrollPane.getViewport().setBackground( new Color( 210, 138, 177 ) );
- this.getContentPane().add( jAddRecordButton,
- new XYConstraints( 32, 448, 102, 52 ) );
- this.getContentPane().add( jDelRecordButton,
- new XYConstraints( 180, 447, 102, 52 ) );
- this.getContentPane().add( jExitButton,
- new XYConstraints( 329, 448, 102, 52 ) );
- this.getContentPane().add( jTableScrollPane,
- new XYConstraints( 3, 3, 458, 421 ) );
- jTableScrollPane.getViewport().add( jRecordTable, null );
- this.setSize( 470, 550 );
- this.setLocation( 230, 100 );
- this.setVisible(true);
- this.setResizable( false );
- }
- void jExitButton_actionPerformed( ActionEvent e ) {
- this.dispose();
- }
- void jAddRecordButton_actionPerformed( ActionEvent e ) {
- AddRecord();
- }
- void jDelRecordButton_actionPerformed( ActionEvent e ) {
- DelRecord();
- }
- public void AddRecord() {
- }
- public void DelRecord() {
- }
- public void UpdateRecord() {
- }
- }