MainFrame.java~67~
资源名称:Java.rar [点击查看]
上传用户:liming9091
上传日期:2014-10-27
资源大小:3376k
文件大小:9k
源码类别:
Java编程
开发平台:
Java
- package manpowersystem;
- import javax.swing.*;
- import java.awt.event.*;
- import java.awt.*;
- import com.borland.jbcl.layout.*;
- import javax.swing.event.*;
- /**
- * <p>Title: </p>
- * <p>Description: </p>
- * <p>Copyright: Copyright (c) 2003</p>
- * <p>Company: </p>
- * @author not attributable
- * @version 1.0
- */
- public class MainFrame extends JFrame {
- private ImageIcon fmImage;
- private XYLayout xYLayout1 = new XYLayout();
- private JButton jTitleButton = new JButton();
- private JButton jOnWorkButton = new JButton();
- private JButton jOffWorkButton = new JButton();
- private JButton jLeaveWorkButton = new JButton();
- private JButton jStaticButton = new JButton();
- private JButton jExitButton = new JButton();
- public MainFrame() {
- try {
- jbInit();
- addWindowListener( new WindowAdapter() {
- public void windowClosing( WindowEvent e ) {
- dispose();
- }
- } );
- }
- catch ( Exception e ) {
- e.printStackTrace();
- }
- }
- public static void main( String[] args ) {
- MainFrame mainFrame = new MainFrame();
- mainFrame.validate();
- mainFrame.setLocation( 200, 150 );
- mainFrame.setSize( 600, 480 );
- mainFrame.setVisible( true );
- mainFrame.pack();
- }
- private void jbInit() throws Exception {
- fmImage = new ImageIcon( manpowersystem.MainFrame.class.getResource(
- "Fengmian.png" ) );
- jTitleButton.setBackground( new Color( 210, 138, 177 ) );
- jTitleButton.setIcon( fmImage );
- jTitleButton.setFocusable( false );
- xYLayout1.setWidth( 540 );
- xYLayout1.setHeight( 407 );
- this.getContentPane().setBackground( new Color( 210, 138, 177 ) );
- this.setLocale( java.util.Locale.getDefault() );
- this.setTitle( "Mini人事管理系统" );
- this.addWindowListener( new MainFrame_this_windowAdapter( this ) );
- this.getContentPane().setLayout( xYLayout1 );
- jOnWorkButton.setBackground( new Color( 212, 158, 217 ) );
- jOnWorkButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
- jOnWorkButton.setText( "上班登记" );
- jOnWorkButton.addActionListener( new
- MainFrame_jOnWorkButton_actionAdapter( this ) );
- jOnWorkButton.addHierarchyBoundsListener( new
- MainFrame_jOnWorkButton_hierarchyBoundsAdapter( this ) );
- jOffWorkButton.setBackground( new Color( 212, 158, 217 ) );
- jOffWorkButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
- jOffWorkButton.setText( "下班登记" );
- jOffWorkButton.addActionListener(new MainFrame_jOffWorkButton_actionAdapter(this));
- jOffWorkButton.addAncestorListener( new
- MainFrame_jOffWorkButton_ancestorAdapter( this ) );
- jLeaveWorkButton.setBackground( new Color( 212, 158, 217 ) );
- jLeaveWorkButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
- jLeaveWorkButton.setText( "请假登记" );
- jLeaveWorkButton.addActionListener(new MainFrame_jLeaveWorkButton_actionAdapter(this));
- jLeaveWorkButton.addAncestorListener( new
- MainFrame_jLeaveWorkButton_ancestorAdapter( this ) );
- jStaticButton.setBackground( new Color( 212, 158, 217 ) );
- jStaticButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
- jStaticButton.setText( "统计情况" );
- jStaticButton.addActionListener(new MainFrame_jStaticButton_actionAdapter(this));
- jStaticButton.addAncestorListener( new
- MainFrame_jStaticButton_ancestorAdapter( this ) );
- jExitButton.setBackground( new Color( 212, 158, 217 ) );
- jExitButton.setFont( new java.awt.Font( "DialogInput", 1, 16 ) );
- jExitButton.setText( "退出系统" );
- jExitButton.addActionListener( new MainFrame_jExitButton_actionAdapter( this ) );
- jExitButton.addAncestorListener( new
- MainFrame_jExitButton_ancestorAdapter( this ) );
- this.getContentPane().add( jTitleButton,
- new XYConstraints( 0, 0, 358, 409 ) );
- this.getContentPane().add( jOnWorkButton,
- new XYConstraints( 393, 35, 115, 45 ) );
- this.getContentPane().add( jOffWorkButton,
- new XYConstraints( 393, 109, 115, 45 ) );
- this.getContentPane().add( jLeaveWorkButton,
- new XYConstraints( 393, 184, 115, 45 ) );
- this.getContentPane().add( jStaticButton,
- new XYConstraints( 393, 258, 115, 45 ) );
- this.getContentPane().add( jExitButton,
- new XYConstraints( 393, 332, 115, 45 ) );
- this.setResizable(false);
- }
- void this_windowClosed( WindowEvent e ) {
- System.exit( 0 );
- }
- void jOffWorkButton_ancestorMoved( AncestorEvent e ) {
- }
- void jLeaveWorkButton_ancestorMoved( AncestorEvent e ) {
- }
- void jStaticButton_ancestorMoved( AncestorEvent e ) {
- }
- void jExitButton_ancestorMoved( AncestorEvent e ) {
- }
- void jExitButton_actionPerformed( ActionEvent e ) {
- System.exit( 0 );
- }
- void jOnWorkButton_actionPerformed( ActionEvent e ) {
- OnWorkPanel onWorkPanel = new OnWorkPanel();
- onWorkPanel.setVisible(true);
- }
- void jOffWorkButton_actionPerformed(ActionEvent e) {
- OffWorkPanel offWorkPanel = new OffWorkPanel();
- offWorkPanel.setVisible(true);
- }
- void jLeaveWorkButton_actionPerformed(ActionEvent e) {
- LeaveWorkPanel leaveWorkPanel = new LeaveWorkPanel();
- leaveWorkPanel.setVisible(true);
- }
- void jStaticButton_actionPerformed(ActionEvent e) {
- StaticPanel staticPanel = new StaticPanel();
- staticPanel.setVisible(true);
- }
- }
- class MainFrame_this_windowAdapter extends java.awt.event.WindowAdapter {
- MainFrame adaptee;
- MainFrame_this_windowAdapter( MainFrame adaptee ) {
- this.adaptee = adaptee;
- }
- public void windowClosed( WindowEvent e ) {
- adaptee.this_windowClosed( e );
- }
- }
- class MainFrame_jOnWorkButton_hierarchyBoundsAdapter extends java.awt.event.
- HierarchyBoundsAdapter {
- MainFrame adaptee;
- MainFrame_jOnWorkButton_hierarchyBoundsAdapter( MainFrame adaptee ) {
- this.adaptee = adaptee;
- }
- }
- class MainFrame_jExitButton_ancestorAdapter implements javax.swing.event.
- AncestorListener {
- MainFrame adaptee;
- MainFrame_jExitButton_ancestorAdapter( MainFrame adaptee ) {
- this.adaptee = adaptee;
- }
- public void ancestorAdded( AncestorEvent e ) {
- }
- public void ancestorRemoved( AncestorEvent e ) {
- }
- public void ancestorMoved( AncestorEvent e ) {
- adaptee.jExitButton_ancestorMoved( e );
- }
- }
- class MainFrame_jExitButton_actionAdapter implements java.awt.event.
- ActionListener {
- MainFrame adaptee;
- MainFrame_jExitButton_actionAdapter( MainFrame adaptee ) {
- this.adaptee = adaptee;
- }
- public void actionPerformed( ActionEvent e ) {
- adaptee.jExitButton_actionPerformed( e );
- }
- }
- class MainFrame_jOnWorkButton_actionAdapter implements java.awt.event.
- ActionListener {
- MainFrame adaptee;
- MainFrame_jOnWorkButton_actionAdapter( MainFrame adaptee ) {
- this.adaptee = adaptee;
- }
- public void actionPerformed( ActionEvent e ) {
- adaptee.jOnWorkButton_actionPerformed( e );
- }
- }
- class MainFrame_jOffWorkButton_actionAdapter implements java.awt.event.ActionListener {
- MainFrame adaptee;
- MainFrame_jOffWorkButton_actionAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
- public void actionPerformed(ActionEvent e) {
- adaptee.jOffWorkButton_actionPerformed(e);
- }
- }
- class MainFrame_jLeaveWorkButton_actionAdapter implements java.awt.event.ActionListener {
- MainFrame adaptee;
- MainFrame_jLeaveWorkButton_actionAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
- public void actionPerformed(ActionEvent e) {
- adaptee.jLeaveWorkButton_actionPerformed(e);
- }
- }
- class MainFrame_jStaticButton_actionAdapter implements java.awt.event.ActionListener {
- MainFrame adaptee;
- MainFrame_jStaticButton_actionAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
- public void actionPerformed(ActionEvent e) {
- adaptee.jStaticButton_actionPerformed(e);
- }
- }