⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tablepanel.java~80~

📁 Java课程设计案例精编源代码__ManpowerSystem.rar
💻 JAVA~80~
字号:
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 {
    Object[][] arrData = {};      //设定表格的字段
    DefaultTableModel tableModel; //表格模型

    int intDelLines;         //显示所选的行数
    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.setSize(600,400);
        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() {

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -