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

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 jOffWorkButton_ancestorMoved( AncestorEvent e ) {
  107.     }
  108.     void jLeaveWorkButton_ancestorMoved( AncestorEvent e ) {
  109.     }
  110.     void jStaticButton_ancestorMoved( AncestorEvent e ) {
  111.     }
  112.     void jExitButton_ancestorMoved( AncestorEvent e ) {
  113.     }
  114.     void jExitButton_actionPerformed( ActionEvent e ) {
  115.         System.exit( 0 );
  116.     }
  117.     void jOnWorkButton_actionPerformed( ActionEvent e ) {
  118.         OnWorkPanel onWorkPanel = new OnWorkPanel();
  119.         onWorkPanel.setVisible(true);
  120.     }
  121.     void jOffWorkButton_actionPerformed(ActionEvent e) {
  122.         OffWorkPanel offWorkPanel = new OffWorkPanel();
  123.         offWorkPanel.setVisible(true);
  124.     }
  125.     void jLeaveWorkButton_actionPerformed(ActionEvent e) {
  126.         LeaveWorkPanel leaveWorkPanel = new LeaveWorkPanel();
  127.         leaveWorkPanel.setVisible(true);
  128.     }
  129.     void jStaticButton_actionPerformed(ActionEvent e) {
  130.         StaticPanel staticPanel = new StaticPanel();
  131.         staticPanel.setVisible(true);
  132.     }
  133. }
  134. class MainFrame_this_windowAdapter extends java.awt.event.WindowAdapter {
  135.     MainFrame adaptee;
  136.     MainFrame_this_windowAdapter( MainFrame adaptee ) {
  137.         this.adaptee = adaptee;
  138.     }
  139.     public void windowClosed( WindowEvent e ) {
  140.         adaptee.this_windowClosed( e );
  141.     }
  142. }
  143. class MainFrame_jOnWorkButton_hierarchyBoundsAdapter extends java.awt.event.
  144.     HierarchyBoundsAdapter {
  145.     MainFrame adaptee;
  146.     MainFrame_jOnWorkButton_hierarchyBoundsAdapter( MainFrame adaptee ) {
  147.         this.adaptee = adaptee;
  148.     }
  149. }
  150. class MainFrame_jExitButton_ancestorAdapter implements javax.swing.event.
  151.     AncestorListener {
  152.     MainFrame adaptee;
  153.     MainFrame_jExitButton_ancestorAdapter( MainFrame adaptee ) {
  154.         this.adaptee = adaptee;
  155.     }
  156.     public void ancestorAdded( AncestorEvent e ) {
  157.     }
  158.     public void ancestorRemoved( AncestorEvent e ) {
  159.     }
  160.     public void ancestorMoved( AncestorEvent e ) {
  161.         adaptee.jExitButton_ancestorMoved( e );
  162.     }
  163. }
  164. class MainFrame_jExitButton_actionAdapter implements java.awt.event.
  165.     ActionListener {
  166.     MainFrame adaptee;
  167.     MainFrame_jExitButton_actionAdapter( MainFrame adaptee ) {
  168.         this.adaptee = adaptee;
  169.     }
  170.     public void actionPerformed( ActionEvent e ) {
  171.         adaptee.jExitButton_actionPerformed( e );
  172.     }
  173. }
  174. class MainFrame_jOnWorkButton_actionAdapter implements java.awt.event.
  175.     ActionListener {
  176.     MainFrame adaptee;
  177.     MainFrame_jOnWorkButton_actionAdapter( MainFrame adaptee ) {
  178.         this.adaptee = adaptee;
  179.     }
  180.     public void actionPerformed( ActionEvent e ) {
  181.         adaptee.jOnWorkButton_actionPerformed( e );
  182.     }
  183. }
  184. class MainFrame_jOffWorkButton_actionAdapter implements java.awt.event.ActionListener {
  185.     MainFrame adaptee;
  186.     MainFrame_jOffWorkButton_actionAdapter(MainFrame adaptee) {
  187.         this.adaptee = adaptee;
  188.     }
  189.     public void actionPerformed(ActionEvent e) {
  190.         adaptee.jOffWorkButton_actionPerformed(e);
  191.     }
  192. }
  193. class MainFrame_jLeaveWorkButton_actionAdapter implements java.awt.event.ActionListener {
  194.     MainFrame adaptee;
  195.     MainFrame_jLeaveWorkButton_actionAdapter(MainFrame adaptee) {
  196.         this.adaptee = adaptee;
  197.     }
  198.     public void actionPerformed(ActionEvent e) {
  199.         adaptee.jLeaveWorkButton_actionPerformed(e);
  200.     }
  201. }
  202. class MainFrame_jStaticButton_actionAdapter implements java.awt.event.ActionListener {
  203.     MainFrame adaptee;
  204.     MainFrame_jStaticButton_actionAdapter(MainFrame adaptee) {
  205.         this.adaptee = adaptee;
  206.     }
  207.     public void actionPerformed(ActionEvent e) {
  208.         adaptee.jStaticButton_actionPerformed(e);
  209.     }
  210. }