RecordPane.java~44~
上传用户: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;     XYLayout xYLayout2 = new XYLayout();
  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(725 );
  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(xYLayout2);
  80.         jClockPanel.setBorder(BorderFactory.createLoweredBevelBorder());
  81.         this.getContentPane().add( jEmployeeNameTextField,
  82.                                    new XYConstraints( 108, 83, 89, 31 ) );
  83.         this.getContentPane().add( jEmployeeIDTextField,
  84.                                     new XYConstraints(15, 83, 81, 31) );
  85.         this.getContentPane().add( jReasonTextField,
  86.                                          new XYConstraints(351, 83, 86, 58) );
  87.         this.getContentPane().add( jOKButton,
  88.                                    new XYConstraints( 91, 220, -1, 35 ) );
  89.         this.getContentPane().add( jResetButton,
  90.                                    new XYConstraints( 206, 220, -1, 35 ) );
  91.         this.getContentPane().add( jExitButton,
  92.                                    new XYConstraints( 318, 220, -1, 35 ) );
  93.         this.getContentPane().add( jIDLabel2,
  94.                                    new XYConstraints( 223, 49, 80, 18 ) );
  95.         this.getContentPane().add( jIDLabel1,
  96.                                    new XYConstraints( 121, 49, 80, 18 ) );
  97.         this.getContentPane().add( jIDLabel4, new XYConstraints( 25, 49, 80, 18 ) );
  98.         this.getContentPane().add( jIDLabel3,
  99.                                    new XYConstraints( 364, 49, 80, 18 ) );
  100.         this.getContentPane().add(jDateTimeTextField,      new XYConstraints(213, 83, 113, 31));
  101.         this.getContentPane().add(jClockPanel,         new XYConstraints(463, 57, -1, 123));         jClockPanel.add(clock, new XYConstraints(0, 0, 145, 118));
  102.     }
  103.     void jExitButton_actionPerformed( ActionEvent e ) {
  104.         this.dispose();
  105.     }
  106.     void jResetButton_actionPerformed( ActionEvent e ) {
  107.         jEmployeeIDTextField.setText( "" );
  108.         jEmployeeNameTextField.setText( "" );
  109.         jReasonTextField.setText( "" );
  110.         jDateTimeTextField.setText( "" );
  111.     }
  112.     void jOKButton_actionPerformed( ActionEvent e ) {
  113.         RestoreRecord();
  114.     }
  115.     public void RestoreRecord() {
  116.     }
  117. }
  118. class RecordPane_jExitButton_actionAdapter implements java.awt.event.
  119.     ActionListener {
  120.     RecordPane adaptee;
  121.     RecordPane_jExitButton_actionAdapter( RecordPane adaptee ) {
  122.         this.adaptee = adaptee;
  123.     }
  124.     public void actionPerformed( ActionEvent e ) {
  125.         adaptee.jExitButton_actionPerformed( e );
  126.     }
  127. }
  128. class RecordPane_jResetButton_actionAdapter implements java.awt.event.
  129.     ActionListener {
  130.     RecordPane adaptee;
  131.     RecordPane_jResetButton_actionAdapter( RecordPane adaptee ) {
  132.         this.adaptee = adaptee;
  133.     }
  134.     public void actionPerformed( ActionEvent e ) {
  135.         adaptee.jResetButton_actionPerformed( e );
  136.     }
  137. }
  138. class RecordPane_jOKButton_actionAdapter implements java.awt.event.
  139.     ActionListener {
  140.     RecordPane adaptee;
  141.     RecordPane_jOKButton_actionAdapter( RecordPane adaptee ) {
  142.         this.adaptee = adaptee;
  143.     }
  144.     public void actionPerformed( ActionEvent e ) {
  145.         adaptee.jOKButton_actionPerformed( e );
  146.     }
  147. }