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

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 javax.swing.*;
  11. import com.borland.jbcl.layout.*;
  12. import java.awt.*;
  13. import java.awt.event.*;
  14. public class RecordPane extends JFrame {
  15.     RecordItem item = new RecordItem();
  16.     Database database = new Database();
  17.     XYLayout xYLayout1 = new XYLayout();
  18.     JTextField jEmployeeIDTextField = new JTextField();
  19.     JTextField jEmployeeNameTextField = new JTextField();
  20.     JTextField jDateTimeTextField = new JTextField();
  21.     JTextField jReasonTextField = new JTextField();
  22.     JButton jOKButton = new JButton();
  23.     JButton jExitButton = new JButton();
  24.     JButton jResetButton = new JButton();
  25.     JLabel jIDLabel1 = new JLabel();
  26.     JLabel jIDLabel2 = new JLabel();
  27.     JLabel jIDLabel3 = new JLabel();
  28.     JLabel jIDLabel4 = new JLabel();
  29.     JPanel jClockPanel = new JPanel();
  30.     Clock clock = new Clock("现在时刻");
  31.     Thread clockThread;
  32.     XYLayout xYLayout2 = new XYLayout();
  33.     JLabel jIDLabel5 = new JLabel();
  34.     public RecordPane() {
  35.         try {
  36.             jbInit();
  37.         }
  38.         catch ( Exception e ) {
  39.             e.printStackTrace();
  40.         }
  41.     }
  42.     public static void main( String[] args ) {
  43.         RecordPane recordPane1 = new RecordPane();
  44.     }
  45.     private void jbInit() throws Exception {
  46.         this.getContentPane().setBackground( new Color( 210, 138, 177 ) );
  47.         this.setFont( new java.awt.Font( "DialogInput", 1, 14 ) );
  48.         this.setTitle( "请添加相应记录" );
  49.         this.getContentPane().setLayout( xYLayout1 );
  50.         xYLayout1.setWidth(725 );
  51.         xYLayout1.setHeight(274 );
  52.         jOKButton.setBackground( new Color( 212, 158, 217 ) );
  53.         jOKButton.setFont( new java.awt.Font( "DialogInput", 1, 14 ) );
  54.         jOKButton.setText( "确定" );
  55.         jOKButton.addActionListener( new RecordPane_jOKButton_actionAdapter( this ) );
  56.         jExitButton.setText( "退出" );
  57.         jExitButton.addActionListener( new RecordPane_jExitButton_actionAdapter( this ) );
  58.         jExitButton.setBackground( new Color( 212, 158, 217 ) );
  59.         jExitButton.setFont( new java.awt.Font( "DialogInput", 1, 14 ) );
  60.         jResetButton.setText( "重写" );
  61.         jResetButton.addActionListener( new
  62.                                         RecordPane_jResetButton_actionAdapter( this ) );
  63.         jResetButton.setBackground( new Color( 212, 158, 217 ) );
  64.         jResetButton.setFont( new java.awt.Font( "DialogInput", 1, 14 ) );
  65.         jReasonTextField.setText( "" );
  66.         jEmployeeIDTextField.setText( "" );
  67.         jEmployeeNameTextField.setText( "" );
  68.         jIDLabel1.setText( "姓名" );
  69.         jIDLabel1.setFont( new java.awt.Font( "SansSerif", 1, 18 ) );
  70.         jIDLabel2.setFont( new java.awt.Font( "SansSerif", 1, 18 ) );
  71.         jIDLabel2.setText( "时间" );
  72.         jIDLabel3.setFont( new java.awt.Font( "SansSerif", 1, 18 ) );
  73.         jIDLabel3.setText( "备注" );
  74.         jIDLabel4.setFont( new java.awt.Font( "SansSerif", 1, 18 ) );
  75.         jIDLabel4.setText( "工号" );
  76.         jDateTimeTextField.setText("");
  77.         //时间盘
  78.         clockThread=new Thread(clock);
  79.         clockThread.start();
  80.         jClockPanel.setBackground(new Color(210, 138, 177));
  81.         jClockPanel.setLayout(xYLayout2);
  82.         jClockPanel.setBorder(BorderFactory.createLoweredBevelBorder());
  83.         jIDLabel5.setText("现在时刻");
  84.         jIDLabel5.setFont(new java.awt.Font( "SansSerif", 1, 18 ));
  85.         this.getContentPane().add( jEmployeeNameTextField,
  86.                                    new XYConstraints( 108, 83, 89, 31 ) );
  87.         this.getContentPane().add( jEmployeeIDTextField,
  88.                                      new XYConstraints(15, 83, 81, 31) );
  89.         this.getContentPane().add( jReasonTextField,
  90.                                           new XYConstraints(351, 83, 86, 58) );
  91.         this.getContentPane().add( jOKButton,
  92.                                    new XYConstraints( 91, 220, -1, 35 ) );
  93.         this.getContentPane().add( jResetButton,
  94.                                    new XYConstraints( 206, 220, -1, 35 ) );
  95.         this.getContentPane().add( jExitButton,
  96.                                    new XYConstraints( 318, 220, -1, 35 ) );
  97.         this.getContentPane().add( jIDLabel2,
  98.                                     new XYConstraints(223, 43, 80, 18) );
  99.         this.getContentPane().add( jIDLabel1,
  100.                                     new XYConstraints(121, 43, 80, 18) );
  101.         this.getContentPane().add( jIDLabel4,  new XYConstraints(25, 43, 80, 18) );
  102.         this.getContentPane().add( jIDLabel3,
  103.                                     new XYConstraints(364, 43, 80, 18) );
  104.         this.getContentPane().add(jDateTimeTextField,       new XYConstraints(213, 83, 113, 31));
  105.         this.getContentPane().add(jIDLabel5,  new XYConstraints(475, 43, 80, 18));         this.getContentPane().add(clock,  new XYConstraints(458, 82, 145, 118));         clock.add(jClockPanel, null);
  106.     }
  107.     void jExitButton_actionPerformed( ActionEvent e ) {
  108.         this.dispose();
  109.     }
  110.     void jResetButton_actionPerformed( ActionEvent e ) {
  111.         jEmployeeIDTextField.setText( "" );
  112.         jEmployeeNameTextField.setText( "" );
  113.         jReasonTextField.setText( "" );
  114.         jDateTimeTextField.setText( "" );
  115.     }
  116.     void jOKButton_actionPerformed( ActionEvent e ) {
  117.         RestoreRecord();
  118.     }
  119.     public void RestoreRecord() {
  120.     }
  121. }
  122. class RecordPane_jExitButton_actionAdapter implements java.awt.event.
  123.     ActionListener {
  124.     RecordPane adaptee;
  125.     RecordPane_jExitButton_actionAdapter( RecordPane adaptee ) {
  126.         this.adaptee = adaptee;
  127.     }
  128.     public void actionPerformed( ActionEvent e ) {
  129.         adaptee.jExitButton_actionPerformed( e );
  130.     }
  131. }
  132. class RecordPane_jResetButton_actionAdapter implements java.awt.event.
  133.     ActionListener {
  134.     RecordPane adaptee;
  135.     RecordPane_jResetButton_actionAdapter( RecordPane adaptee ) {
  136.         this.adaptee = adaptee;
  137.     }
  138.     public void actionPerformed( ActionEvent e ) {
  139.         adaptee.jResetButton_actionPerformed( e );
  140.     }
  141. }
  142. class RecordPane_jOKButton_actionAdapter implements java.awt.event.
  143.     ActionListener {
  144.     RecordPane adaptee;
  145.     RecordPane_jOKButton_actionAdapter( RecordPane adaptee ) {
  146.         this.adaptee = adaptee;
  147.     }
  148.     public void actionPerformed( ActionEvent e ) {
  149.         adaptee.jOKButton_actionPerformed( e );
  150.     }
  151. }