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

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.     XYLayout xYLayout1 = new XYLayout();
  18.     JButton jTitleButton = new JButton();
  19.     JButton jOnWorkButton = new JButton();
  20.     JButton jOffWorkButton = new JButton();
  21.     JButton jLeaveWorkButton = new JButton();
  22.     JButton jStaticButton = new JButton();
  23.     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.setResizable( true );
  56.         this.setTitle( "Mini人事管理系统" );
  57.         this.addWindowListener( new MainFrame_this_windowAdapter( this ) );
  58.         this.getContentPane().setLayout( xYLayout1 );
  59.         jOnWorkButton.setBackground( new Color( 212, 158, 217 ) );
  60.         jOnWorkButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
  61.         jOnWorkButton.setText( "上班登记" );
  62.         jOnWorkButton.addActionListener( new
  63.                                          MainFrame_jOnWorkButton_actionAdapter( this ) );
  64.         jOnWorkButton.addHierarchyBoundsListener( new
  65.             MainFrame_jOnWorkButton_hierarchyBoundsAdapter( this ) );
  66.         jOffWorkButton.setBackground( new Color( 212, 158, 217 ) );
  67.         jOffWorkButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
  68.         jOffWorkButton.setText( "下班登记" );
  69.         jOffWorkButton.addActionListener(new MainFrame_jOffWorkButton_actionAdapter(this));
  70.         jOffWorkButton.addAncestorListener( new
  71.             MainFrame_jOffWorkButton_ancestorAdapter( this ) );
  72.         jLeaveWorkButton.setBackground( new Color( 212, 158, 217 ) );
  73.         jLeaveWorkButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
  74.         jLeaveWorkButton.setText( "请假登记" );
  75.         jLeaveWorkButton.addActionListener(new MainFrame_jLeaveWorkButton_actionAdapter(this));
  76.         jLeaveWorkButton.addAncestorListener( new
  77.             MainFrame_jLeaveWorkButton_ancestorAdapter( this ) );
  78.         jStaticButton.setBackground( new Color( 212, 158, 217 ) );
  79.         jStaticButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
  80.         jStaticButton.setText( "统计情况" );
  81.         jStaticButton.addActionListener(new MainFrame_jStaticButton_actionAdapter(this));
  82.         jStaticButton.addAncestorListener( new
  83.             MainFrame_jStaticButton_ancestorAdapter( this ) );
  84.         jExitButton.setBackground( new Color( 212, 158, 217 ) );
  85.         jExitButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
  86.         jExitButton.setText( "退出系统" );
  87.         jExitButton.addActionListener( new MainFrame_jExitButton_actionAdapter( this ) );
  88.         jExitButton.addAncestorListener( new
  89.                                          MainFrame_jExitButton_ancestorAdapter( this ) );
  90.         this.getContentPane().add( jTitleButton,
  91.                                    new XYConstraints( 0, 0, 358, 409 ) );
  92.         this.getContentPane().add( jOnWorkButton,
  93.                                    new XYConstraints( 393, 35, 115, 45 ) );
  94.         this.getContentPane().add( jOffWorkButton,
  95.                                    new XYConstraints( 393, 109, 115, 45 ) );
  96.         this.getContentPane().add( jLeaveWorkButton,
  97.                                    new XYConstraints( 393, 184, 115, 45 ) );
  98.         this.getContentPane().add( jStaticButton,
  99.                                    new XYConstraints( 393, 258, 115, 45 ) );
  100.         this.getContentPane().add( jExitButton,
  101.                                    new XYConstraints( 393, 332, 115, 45 ) );
  102.         this.setResizable(false);
  103.     }
  104.     void this_windowClosed( WindowEvent e ) {
  105.         System.exit( 0 );
  106.     }
  107.     void jOnWorkButton_ancestorMoved( HierarchyEvent e ) {
  108.     }
  109.     void jOffWorkButton_ancestorMoved( AncestorEvent e ) {
  110.     }
  111.     void jLeaveWorkButton_ancestorMoved( AncestorEvent e ) {
  112.     }
  113.     void jStaticButton_ancestorMoved( AncestorEvent e ) {
  114.     }
  115.     void jExitButton_ancestorMoved( AncestorEvent e ) {
  116.     }
  117.     void jExitButton_actionPerformed( ActionEvent e ) {
  118.         System.exit( 0 );
  119.     }
  120.     void jOnWorkButton_actionPerformed( ActionEvent e ) {
  121.         OnWorkPanel onWorkPanel = new OnWorkPanel();
  122.         onWorkPanel.setVisible(true);
  123.     }
  124.     void jOffWorkButton_actionPerformed(ActionEvent e) {
  125.         OffWorkPanel offWorkPanel = new OffWorkPanel();
  126.         offWorkPanel.setVisible(true);
  127.     }
  128.     void jLeaveWorkButton_actionPerformed(ActionEvent e) {
  129.         LeaveWorkPanel leaveWorkPanel = new LeaveWorkPanel();
  130.         leaveWorkPanel.setVisible(true);
  131.     }
  132.     void jStaticButton_actionPerformed(ActionEvent e) {
  133.         StaticPanel staticPanel = new StaticPanel();
  134.         staticPanel.setVisible(true);
  135.     }
  136. }
  137. class MainFrame_this_windowAdapter extends java.awt.event.WindowAdapter {
  138.     MainFrame adaptee;
  139.     MainFrame_this_windowAdapter( MainFrame adaptee ) {
  140.         this.adaptee = adaptee;
  141.     }
  142.     public void windowClosed( WindowEvent e ) {
  143.         adaptee.this_windowClosed( e );
  144.     }
  145. }
  146. class MainFrame_jOnWorkButton_hierarchyBoundsAdapter extends java.awt.event.
  147.     HierarchyBoundsAdapter {
  148.     MainFrame adaptee;
  149.     MainFrame_jOnWorkButton_hierarchyBoundsAdapter( MainFrame adaptee ) {
  150.         this.adaptee = adaptee;
  151.     }
  152.     public void ancestorMoved( HierarchyEvent e ) {
  153.         adaptee.jOnWorkButton_ancestorMoved( e );
  154.     }
  155. }
  156. class MainFrame_jOffWorkButton_ancestorAdapter implements javax.swing.event.
  157.     AncestorListener {
  158.     MainFrame adaptee;
  159.     MainFrame_jOffWorkButton_ancestorAdapter( MainFrame adaptee ) {
  160.         this.adaptee = adaptee;
  161.     }
  162.     public void ancestorAdded( AncestorEvent e ) {
  163.     }
  164.     public void ancestorRemoved( AncestorEvent e ) {
  165.     }
  166.     public void ancestorMoved( AncestorEvent e ) {
  167.         adaptee.jOffWorkButton_ancestorMoved( e );
  168.     }
  169. }
  170. class MainFrame_jLeaveWorkButton_ancestorAdapter implements javax.swing.event.
  171.     AncestorListener {
  172.     MainFrame adaptee;
  173.     MainFrame_jLeaveWorkButton_ancestorAdapter( MainFrame adaptee ) {
  174.         this.adaptee = adaptee;
  175.     }
  176.     public void ancestorAdded( AncestorEvent e ) {
  177.     }
  178.     public void ancestorRemoved( AncestorEvent e ) {
  179.     }
  180.     public void ancestorMoved( AncestorEvent e ) {
  181.         adaptee.jLeaveWorkButton_ancestorMoved( e );
  182.     }
  183. }
  184. class MainFrame_jStaticButton_ancestorAdapter implements javax.swing.event.
  185.     AncestorListener {
  186.     MainFrame adaptee;
  187.     MainFrame_jStaticButton_ancestorAdapter( MainFrame adaptee ) {
  188.         this.adaptee = adaptee;
  189.     }
  190.     public void ancestorAdded( AncestorEvent e ) {
  191.     }
  192.     public void ancestorRemoved( AncestorEvent e ) {
  193.     }
  194.     public void ancestorMoved( AncestorEvent e ) {
  195.         adaptee.jStaticButton_ancestorMoved( e );
  196.     }
  197. }
  198. class MainFrame_jExitButton_ancestorAdapter implements javax.swing.event.
  199.     AncestorListener {
  200.     MainFrame adaptee;
  201.     MainFrame_jExitButton_ancestorAdapter( MainFrame adaptee ) {
  202.         this.adaptee = adaptee;
  203.     }
  204.     public void ancestorAdded( AncestorEvent e ) {
  205.     }
  206.     public void ancestorRemoved( AncestorEvent e ) {
  207.     }
  208.     public void ancestorMoved( AncestorEvent e ) {
  209.         adaptee.jExitButton_ancestorMoved( e );
  210.     }
  211. }
  212. class MainFrame_jExitButton_actionAdapter implements java.awt.event.
  213.     ActionListener {
  214.     MainFrame adaptee;
  215.     MainFrame_jExitButton_actionAdapter( MainFrame adaptee ) {
  216.         this.adaptee = adaptee;
  217.     }
  218.     public void actionPerformed( ActionEvent e ) {
  219.         adaptee.jExitButton_actionPerformed( e );
  220.     }
  221. }
  222. class MainFrame_jOnWorkButton_actionAdapter implements java.awt.event.
  223.     ActionListener {
  224.     MainFrame adaptee;
  225.     MainFrame_jOnWorkButton_actionAdapter( MainFrame adaptee ) {
  226.         this.adaptee = adaptee;
  227.     }
  228.     public void actionPerformed( ActionEvent e ) {
  229.         adaptee.jOnWorkButton_actionPerformed( e );
  230.     }
  231. }
  232. class MainFrame_jOffWorkButton_actionAdapter implements java.awt.event.ActionListener {
  233.     MainFrame adaptee;
  234.     MainFrame_jOffWorkButton_actionAdapter(MainFrame adaptee) {
  235.         this.adaptee = adaptee;
  236.     }
  237.     public void actionPerformed(ActionEvent e) {
  238.         adaptee.jOffWorkButton_actionPerformed(e);
  239.     }
  240. }
  241. class MainFrame_jLeaveWorkButton_actionAdapter implements java.awt.event.ActionListener {
  242.     MainFrame adaptee;
  243.     MainFrame_jLeaveWorkButton_actionAdapter(MainFrame adaptee) {
  244.         this.adaptee = adaptee;
  245.     }
  246.     public void actionPerformed(ActionEvent e) {
  247.         adaptee.jLeaveWorkButton_actionPerformed(e);
  248.     }
  249. }
  250. class MainFrame_jStaticButton_actionAdapter implements java.awt.event.ActionListener {
  251.     MainFrame adaptee;
  252.     MainFrame_jStaticButton_actionAdapter(MainFrame adaptee) {
  253.         this.adaptee = adaptee;
  254.     }
  255.     public void actionPerformed(ActionEvent e) {
  256.         adaptee.jStaticButton_actionPerformed(e);
  257.     }
  258. }