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

Java编程

开发平台:

Java

  1. package manpowersystem;
  2. import javax.swing.*;
  3. import java.awt.event.*;
  4. import java.awt.*;
  5. import com.borland.jbcl.layout.*;
  6. import javax.swing.event.*;
  7. /**
  8.  * <p>Title: </p>
  9.  * <p>Description: </p>
  10.  * <p>Copyright: Copyright (c) 2003</p>
  11.  * <p>Company: </p>
  12.  * @author not attributable
  13.  * @version 1.0
  14.  */
  15. public class MainFrame extends JFrame {
  16.     private ImageIcon fmImage;
  17.     private XYLayout xYLayout1 = new XYLayout();
  18.     private JButton jTitleButton = new JButton();
  19.     private JButton jOnWorkButton = new JButton();
  20.     private JButton jOffWorkButton = new JButton();
  21.     private JButton jLeaveWorkButton = new JButton();
  22.     private JButton jStaticButton = new JButton();
  23.     private JButton jExitButton = new JButton();
  24.     public MainFrame() {
  25.         try {
  26.             jbInit();
  27.             addWindowListener( new WindowAdapter() {
  28.                 public void windowClosing( WindowEvent e ) {
  29.                     dispose();
  30.                 }
  31.             } );
  32.         }
  33.         catch ( Exception e ) {
  34.             e.printStackTrace();
  35.         }
  36.     }
  37.     public static void main( String[] args ) {
  38.         MainFrame mainFrame = new MainFrame();
  39.         mainFrame.validate();
  40.         mainFrame.setLocation( 200, 150 );
  41.         mainFrame.setSize( 600, 480 );
  42.         mainFrame.setVisible( true );
  43.         mainFrame.pack();
  44.     }
  45.     private void jbInit() throws Exception {
  46.         fmImage = new ImageIcon( manpowersystem.MainFrame.class.getResource(
  47.             "Fengmian.png" ) );
  48.         jTitleButton.setBackground( new Color( 210, 138, 177 ) );
  49.         jTitleButton.setIcon( fmImage );
  50.         jTitleButton.setFocusable( false );
  51.         xYLayout1.setWidth( 540 );
  52.         xYLayout1.setHeight( 407 );
  53.         this.getContentPane().setBackground( new Color( 210, 138, 177 ) );
  54.         this.setLocale( java.util.Locale.getDefault() );
  55.         this.setTitle( "Mini人事管理系统" );
  56.         this.addWindowListener( new MainFrame_this_windowAdapter( this ) );
  57.         this.getContentPane().setLayout( xYLayout1 );
  58.         jOnWorkButton.setBackground( new Color( 212, 158, 217 ) );
  59.         jOnWorkButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
  60.         jOnWorkButton.setText( "上班登记" );
  61.         jOnWorkButton.addActionListener( new
  62.                                          MainFrame_jOnWorkButton_actionAdapter( this ) );
  63.         jOnWorkButton.addHierarchyBoundsListener( new
  64.             MainFrame_jOnWorkButton_hierarchyBoundsAdapter( this ) );
  65.         jOffWorkButton.setBackground( new Color( 212, 158, 217 ) );
  66.         jOffWorkButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
  67.         jOffWorkButton.setText( "下班登记" );
  68.         jOffWorkButton.addActionListener(new MainFrame_jOffWorkButton_actionAdapter(this));
  69.         jOffWorkButton.addAncestorListener( new
  70.             MainFrame_jOffWorkButton_ancestorAdapter( this ) );
  71.         jLeaveWorkButton.setBackground( new Color( 212, 158, 217 ) );
  72.         jLeaveWorkButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
  73.         jLeaveWorkButton.setText( "请假登记" );
  74.         jLeaveWorkButton.addActionListener(new MainFrame_jLeaveWorkButton_actionAdapter(this));
  75.         jLeaveWorkButton.addAncestorListener( new
  76.             MainFrame_jLeaveWorkButton_ancestorAdapter( this ) );
  77.         jStaticButton.setBackground( new Color( 212, 158, 217 ) );
  78.         jStaticButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
  79.         jStaticButton.setText( "统计情况" );
  80.         jStaticButton.addActionListener(new MainFrame_jStaticButton_actionAdapter(this));
  81.         jStaticButton.addAncestorListener( new
  82.             MainFrame_jStaticButton_ancestorAdapter( this ) );
  83.         jExitButton.setBackground( new Color( 212, 158, 217 ) );
  84.         jExitButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
  85.         jExitButton.setText( "退出系统" );
  86.         jExitButton.addActionListener( new MainFrame_jExitButton_actionAdapter( this ) );
  87.         jExitButton.addAncestorListener( new
  88.                                          MainFrame_jExitButton_ancestorAdapter( this ) );
  89.         this.getContentPane().add( jTitleButton,
  90.                                    new XYConstraints( 0, 0, 358, 409 ) );
  91.         this.getContentPane().add( jOnWorkButton,
  92.                                    new XYConstraints( 393, 35, 115, 45 ) );
  93.         this.getContentPane().add( jOffWorkButton,
  94.                                    new XYConstraints( 393, 109, 115, 45 ) );
  95.         this.getContentPane().add( jLeaveWorkButton,
  96.                                    new XYConstraints( 393, 184, 115, 45 ) );
  97.         this.getContentPane().add( jStaticButton,
  98.                                    new XYConstraints( 393, 258, 115, 45 ) );
  99.         this.getContentPane().add( jExitButton,
  100.                                    new XYConstraints( 393, 332, 115, 45 ) );
  101.         this.setResizable(false);
  102.     }
  103.     void this_windowClosed( WindowEvent e ) {
  104.         System.exit( 0 );
  105.     }
  106.     void jExitButton_actionPerformed( ActionEvent e ) {
  107.         System.exit( 0 );
  108.     }
  109.     void jOnWorkButton_actionPerformed( ActionEvent e ) {
  110.         OnWorkPanel onWorkPanel = new OnWorkPanel();
  111.         onWorkPanel.setVisible(true);
  112.     }
  113.     void jOffWorkButton_actionPerformed(ActionEvent e) {
  114.         OffWorkPanel offWorkPanel = new OffWorkPanel();
  115.         offWorkPanel.setVisible(true);
  116.     }
  117.     void jLeaveWorkButton_actionPerformed(ActionEvent e) {
  118.         LeaveWorkPanel leaveWorkPanel = new LeaveWorkPanel();
  119.         leaveWorkPanel.setVisible(true);
  120.     }
  121.     void jStaticButton_actionPerformed(ActionEvent e) {
  122.         StaticPanel staticPanel = new StaticPanel();
  123.         staticPanel.setVisible(true);
  124.     }
  125. }
  126. class MainFrame_this_windowAdapter extends java.awt.event.WindowAdapter {
  127.     MainFrame adaptee;
  128.     MainFrame_this_windowAdapter( MainFrame adaptee ) {
  129.         this.adaptee = adaptee;
  130.     }
  131.     public void windowClosed( WindowEvent e ) {
  132.         adaptee.this_windowClosed( e );
  133.     }
  134. }
  135. class MainFrame_jExitButton_actionAdapter implements java.awt.event.
  136.     ActionListener {
  137.     MainFrame adaptee;
  138.     MainFrame_jExitButton_actionAdapter( MainFrame adaptee ) {
  139.         this.adaptee = adaptee;
  140.     }
  141.     public void actionPerformed( ActionEvent e ) {
  142.         adaptee.jExitButton_actionPerformed( e );
  143.     }
  144. }
  145. class MainFrame_jOnWorkButton_actionAdapter implements java.awt.event.
  146.     ActionListener {
  147.     MainFrame adaptee;
  148.     MainFrame_jOnWorkButton_actionAdapter( MainFrame adaptee ) {
  149.         this.adaptee = adaptee;
  150.     }
  151.     public void actionPerformed( ActionEvent e ) {
  152.         adaptee.jOnWorkButton_actionPerformed( e );
  153.     }
  154. }
  155. class MainFrame_jOffWorkButton_actionAdapter implements java.awt.event.ActionListener {
  156.     MainFrame adaptee;
  157.     MainFrame_jOffWorkButton_actionAdapter(MainFrame adaptee) {
  158.         this.adaptee = adaptee;
  159.     }
  160.     public void actionPerformed(ActionEvent e) {
  161.         adaptee.jOffWorkButton_actionPerformed(e);
  162.     }
  163. }
  164. class MainFrame_jLeaveWorkButton_actionAdapter implements java.awt.event.ActionListener {
  165.     MainFrame adaptee;
  166.     MainFrame_jLeaveWorkButton_actionAdapter(MainFrame adaptee) {
  167.         this.adaptee = adaptee;
  168.     }
  169.     public void actionPerformed(ActionEvent e) {
  170.         adaptee.jLeaveWorkButton_actionPerformed(e);
  171.     }
  172. }
  173. class MainFrame_jStaticButton_actionAdapter implements java.awt.event.ActionListener {
  174.     MainFrame adaptee;
  175.     MainFrame_jStaticButton_actionAdapter(MainFrame adaptee) {
  176.         this.adaptee = adaptee;
  177.     }
  178.     public void actionPerformed(ActionEvent e) {
  179.         adaptee.jStaticButton_actionPerformed(e);
  180.     }
  181. }