MainFrame.java~60~
上传用户: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.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 jOnWorkButton_ancestorMoved( HierarchyEvent e ) {
  107.     }
  108.     void jOffWorkButton_ancestorMoved( AncestorEvent e ) {
  109.     }
  110.     void jLeaveWorkButton_ancestorMoved( AncestorEvent e ) {
  111.     }
  112.     void jStaticButton_ancestorMoved( AncestorEvent e ) {
  113.     }
  114.     void jExitButton_ancestorMoved( AncestorEvent e ) {
  115.     }
  116.     void jExitButton_actionPerformed( ActionEvent e ) {
  117.         System.exit( 0 );
  118.     }
  119.     void jOnWorkButton_actionPerformed( ActionEvent e ) {
  120.         OnWorkPanel onWorkPanel = new OnWorkPanel();
  121.         onWorkPanel.setVisible(true);
  122.     }
  123.     void jOffWorkButton_actionPerformed(ActionEvent e) {
  124.         OffWorkPanel offWorkPanel = new OffWorkPanel();
  125.         offWorkPanel.setVisible(true);
  126.     }
  127.     void jLeaveWorkButton_actionPerformed(ActionEvent e) {
  128.         OffWorkPanel offWorkPanel = new OffWorkPanel();
  129.         offWorkPanel.setVisible(true);
  130.     }
  131. }
  132. class MainFrame_this_windowAdapter extends java.awt.event.WindowAdapter {
  133.     MainFrame adaptee;
  134.     MainFrame_this_windowAdapter( MainFrame adaptee ) {
  135.         this.adaptee = adaptee;
  136.     }
  137.     public void windowClosed( WindowEvent e ) {
  138.         adaptee.this_windowClosed( e );
  139.     }
  140. }
  141. class MainFrame_jOnWorkButton_hierarchyBoundsAdapter extends java.awt.event.
  142.     HierarchyBoundsAdapter {
  143.     MainFrame adaptee;
  144.     MainFrame_jOnWorkButton_hierarchyBoundsAdapter( MainFrame adaptee ) {
  145.         this.adaptee = adaptee;
  146.     }
  147.     public void ancestorMoved( HierarchyEvent e ) {
  148.         adaptee.jOnWorkButton_ancestorMoved( e );
  149.     }
  150. }
  151. class MainFrame_jOffWorkButton_ancestorAdapter implements javax.swing.event.
  152.     AncestorListener {
  153.     MainFrame adaptee;
  154.     MainFrame_jOffWorkButton_ancestorAdapter( MainFrame adaptee ) {
  155.         this.adaptee = adaptee;
  156.     }
  157.     public void ancestorAdded( AncestorEvent e ) {
  158.     }
  159.     public void ancestorRemoved( AncestorEvent e ) {
  160.     }
  161.     public void ancestorMoved( AncestorEvent e ) {
  162.         adaptee.jOffWorkButton_ancestorMoved( e );
  163.     }
  164. }
  165. class MainFrame_jLeaveWorkButton_ancestorAdapter implements javax.swing.event.
  166.     AncestorListener {
  167.     MainFrame adaptee;
  168.     MainFrame_jLeaveWorkButton_ancestorAdapter( MainFrame adaptee ) {
  169.         this.adaptee = adaptee;
  170.     }
  171.     public void ancestorAdded( AncestorEvent e ) {
  172.     }
  173.     public void ancestorRemoved( AncestorEvent e ) {
  174.     }
  175.     public void ancestorMoved( AncestorEvent e ) {
  176.         adaptee.jLeaveWorkButton_ancestorMoved( e );
  177.     }
  178. }
  179. class MainFrame_jStaticButton_ancestorAdapter implements javax.swing.event.
  180.     AncestorListener {
  181.     MainFrame adaptee;
  182.     MainFrame_jStaticButton_ancestorAdapter( MainFrame adaptee ) {
  183.         this.adaptee = adaptee;
  184.     }
  185.     public void ancestorAdded( AncestorEvent e ) {
  186.     }
  187.     public void ancestorRemoved( AncestorEvent e ) {
  188.     }
  189.     public void ancestorMoved( AncestorEvent e ) {
  190.         adaptee.jStaticButton_ancestorMoved( e );
  191.     }
  192. }
  193. class MainFrame_jExitButton_ancestorAdapter implements javax.swing.event.
  194.     AncestorListener {
  195.     MainFrame adaptee;
  196.     MainFrame_jExitButton_ancestorAdapter( MainFrame adaptee ) {
  197.         this.adaptee = adaptee;
  198.     }
  199.     public void ancestorAdded( AncestorEvent e ) {
  200.     }
  201.     public void ancestorRemoved( AncestorEvent e ) {
  202.     }
  203.     public void ancestorMoved( AncestorEvent e ) {
  204.         adaptee.jExitButton_ancestorMoved( e );
  205.     }
  206. }
  207. class MainFrame_jExitButton_actionAdapter implements java.awt.event.
  208.     ActionListener {
  209.     MainFrame adaptee;
  210.     MainFrame_jExitButton_actionAdapter( MainFrame adaptee ) {
  211.         this.adaptee = adaptee;
  212.     }
  213.     public void actionPerformed( ActionEvent e ) {
  214.         adaptee.jExitButton_actionPerformed( e );
  215.     }
  216. }
  217. class MainFrame_jOnWorkButton_actionAdapter implements java.awt.event.
  218.     ActionListener {
  219.     MainFrame adaptee;
  220.     MainFrame_jOnWorkButton_actionAdapter( MainFrame adaptee ) {
  221.         this.adaptee = adaptee;
  222.     }
  223.     public void actionPerformed( ActionEvent e ) {
  224.         adaptee.jOnWorkButton_actionPerformed( e );
  225.     }
  226. }
  227. class MainFrame_jOffWorkButton_actionAdapter implements java.awt.event.ActionListener {
  228.     MainFrame adaptee;
  229.     MainFrame_jOffWorkButton_actionAdapter(MainFrame adaptee) {
  230.         this.adaptee = adaptee;
  231.     }
  232.     public void actionPerformed(ActionEvent e) {
  233.         adaptee.jOffWorkButton_actionPerformed(e);
  234.     }
  235. }
  236. class MainFrame_jLeaveWorkButton_actionAdapter implements java.awt.event.ActionListener {
  237.     MainFrame adaptee;
  238.     MainFrame_jLeaveWorkButton_actionAdapter(MainFrame adaptee) {
  239.         this.adaptee = adaptee;
  240.     }
  241.     public void actionPerformed(ActionEvent e) {
  242.         adaptee.jLeaveWorkButton_actionPerformed(e);
  243.     }
  244. }