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

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