RecordPane.java
资源名称:Java.rar [点击查看]
上传用户:liming9091
上传日期:2014-10-27
资源大小:3376k
文件大小:7k
源码类别:
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 javax.swing.*;
- import com.borland.jbcl.layout.*;
- import java.awt.*;
- import java.awt.event.*;
- public class RecordPane extends JFrame {
- RecordItem item = new RecordItem();
- Database database = new Database();
- XYLayout xYLayout1 = new XYLayout();
- JTextField jEmployeeIDTextField = new JTextField();
- JTextField jEmployeeNameTextField = new JTextField();
- JTextField jDateTimeTextField = new JTextField();
- JTextField jReasonTextField = new JTextField();
- JButton jOKButton = new JButton();
- JButton jExitButton = new JButton();
- JButton jResetButton = new JButton();
- JLabel jIDLabel1 = new JLabel();
- JLabel jIDLabel2 = new JLabel();
- JLabel jIDLabel3 = new JLabel();
- JLabel jIDLabel4 = new JLabel();
- JPanel jClockPanel = new JPanel();
- Clock clock = new Clock("现在时刻");
- Thread clockThread;
- XYLayout xYLayout2 = new XYLayout();
- JLabel jIDLabel5 = new JLabel();
- public RecordPane() {
- try {
- jbInit();
- }
- catch ( Exception e ) {
- e.printStackTrace();
- }
- }
- public static void main( String[] args ) {
- RecordPane recordPane1 = new RecordPane();
- }
- private void jbInit() throws Exception {
- this.getContentPane().setBackground( new Color( 210, 138, 177 ) );
- this.setFont( new java.awt.Font( "DialogInput", 1, 14 ) );
- this.setTitle( "请添加相应记录" );
- this.getContentPane().setLayout( xYLayout1 );
- xYLayout1.setWidth(725 );
- xYLayout1.setHeight(274 );
- jOKButton.setBackground( new Color( 212, 158, 217 ) );
- jOKButton.setFont( new java.awt.Font( "DialogInput", 1, 14 ) );
- jOKButton.setText( "确定" );
- jOKButton.addActionListener( new RecordPane_jOKButton_actionAdapter( this ) );
- jExitButton.setText( "退出" );
- jExitButton.addActionListener( new RecordPane_jExitButton_actionAdapter( this ) );
- jExitButton.setBackground( new Color( 212, 158, 217 ) );
- jExitButton.setFont( new java.awt.Font( "DialogInput", 1, 14 ) );
- jResetButton.setText( "重写" );
- jResetButton.addActionListener( new
- RecordPane_jResetButton_actionAdapter( this ) );
- jResetButton.setBackground( new Color( 212, 158, 217 ) );
- jResetButton.setFont( new java.awt.Font( "DialogInput", 1, 14 ) );
- jReasonTextField.setText( "" );
- jEmployeeIDTextField.setText( "" );
- jEmployeeNameTextField.setText( "" );
- jIDLabel1.setText( "姓名" );
- jIDLabel1.setFont( new java.awt.Font( "SansSerif", 1, 18 ) );
- jIDLabel2.setFont( new java.awt.Font( "SansSerif", 1, 18 ) );
- jIDLabel2.setText( "时间" );
- jIDLabel3.setFont( new java.awt.Font( "SansSerif", 1, 18 ) );
- jIDLabel3.setText( "备注" );
- jIDLabel4.setFont( new java.awt.Font( "SansSerif", 1, 18 ) );
- jIDLabel4.setText( "工号" );
- jDateTimeTextField.setText("");
- //时间盘
- clockThread=new Thread(clock);
- clockThread.start();
- jClockPanel.setBackground(new Color(210, 138, 177));
- jClockPanel.setLayout(xYLayout2);
- jClockPanel.setBorder(BorderFactory.createLoweredBevelBorder());
- jIDLabel5.setText("现在时刻");
- jIDLabel5.setFont(new java.awt.Font( "SansSerif", 1, 18 ));
- this.getContentPane().add( jEmployeeNameTextField,
- new XYConstraints( 108, 83, 89, 31 ) );
- this.getContentPane().add( jEmployeeIDTextField,
- new XYConstraints(15, 83, 81, 31) );
- this.getContentPane().add( jReasonTextField,
- new XYConstraints(351, 83, 86, 58) );
- this.getContentPane().add( jOKButton,
- new XYConstraints( 91, 220, -1, 35 ) );
- this.getContentPane().add( jResetButton,
- new XYConstraints( 206, 220, -1, 35 ) );
- this.getContentPane().add( jExitButton,
- new XYConstraints( 318, 220, -1, 35 ) );
- this.getContentPane().add( jIDLabel2,
- new XYConstraints(223, 43, 80, 18) );
- this.getContentPane().add( jIDLabel1,
- new XYConstraints(121, 43, 80, 18) );
- this.getContentPane().add( jIDLabel4, new XYConstraints(25, 43, 80, 18) );
- this.getContentPane().add( jIDLabel3,
- new XYConstraints(364, 43, 80, 18) );
- this.getContentPane().add(jDateTimeTextField, new XYConstraints(213, 83, 113, 31));
- this.getContentPane().add(jIDLabel5, new XYConstraints(475, 43, 80, 18)); this.getContentPane().add(clock, new XYConstraints(458, 82, 145, 118)); clock.add(jClockPanel, null);
- }
- void jExitButton_actionPerformed( ActionEvent e ) {
- this.dispose();
- }
- void jResetButton_actionPerformed( ActionEvent e ) {
- jEmployeeIDTextField.setText( "" );
- jEmployeeNameTextField.setText( "" );
- jReasonTextField.setText( "" );
- jDateTimeTextField.setText( "" );
- }
- void jOKButton_actionPerformed( ActionEvent e ) {
- RestoreRecord();
- }
- public void RestoreRecord() {
- }
- }
- class RecordPane_jExitButton_actionAdapter implements java.awt.event.
- ActionListener {
- RecordPane adaptee;
- RecordPane_jExitButton_actionAdapter( RecordPane adaptee ) {
- this.adaptee = adaptee;
- }
- public void actionPerformed( ActionEvent e ) {
- adaptee.jExitButton_actionPerformed( e );
- }
- }
- class RecordPane_jResetButton_actionAdapter implements java.awt.event.
- ActionListener {
- RecordPane adaptee;
- RecordPane_jResetButton_actionAdapter( RecordPane adaptee ) {
- this.adaptee = adaptee;
- }
- public void actionPerformed( ActionEvent e ) {
- adaptee.jResetButton_actionPerformed( e );
- }
- }
- class RecordPane_jOKButton_actionAdapter implements java.awt.event.
- ActionListener {
- RecordPane adaptee;
- RecordPane_jOKButton_actionAdapter( RecordPane adaptee ) {
- this.adaptee = adaptee;
- }
- public void actionPerformed( ActionEvent e ) {
- adaptee.jOKButton_actionPerformed( e );
- }
- }