⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zhuframe.java

📁 机房网吧刷卡计费
💻 JAVA
字号:
package cn.com.S1t55.killer.view;

import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JButton;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import cn.com.S1t55.killer.view.DengFrame;
import cn.com.S1t55.killer.view.RuanJianFrame;
import java.awt.Toolkit;
import javax.swing.JLabel;
import java.awt.*;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2007</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class ZhuFrame extends JFrame {
    JPanel contentPane;
    JMenuBar jMenuBar1 = new JMenuBar();
    JMenu jMenu1 = new JMenu();
    JMenuItem jMenuItem1 = new JMenuItem();
    JMenuItem jMenuItem2 = new JMenuItem();
    JButton btnShangwang = new JButton();
    JButton btnGuan = new JButton();
    JMenuItem jMenuItem3 = new JMenuItem();
    JButton btnTui = new JButton();
    public ZhuFrame() {
        try {
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    /**
     * Component initialization.
     *
     * @throws java.lang.Exception
     */
    private void jbInit() throws Exception {
        contentPane = (JPanel) getContentPane();
        contentPane.setLayout(null);
        this.setJMenuBar(jMenuBar1);
        this.setResizable(false);
        setSize(new Dimension(800, 600));
        setTitle("欢迎光临!!");
        jMenu1.setText("菜单");
        jMenuItem1.setText("上网冲浪");
        jMenuItem1.addActionListener(new ZhuFrame_jMenuItem1_actionAdapter(this));
        jMenuItem2.setText("管理登陆");
        jMenuItem2.addActionListener(new ZhuFrame_jMenuItem2_actionAdapter(this));
        btnShangwang.setBounds(new Rectangle(65, 130, 87, 33));
        btnShangwang.setText("上网冲浪");
        btnShangwang.addActionListener(new ZhuFrame_jButton1_actionAdapter(this));
        btnGuan.setBounds(new Rectangle(161, 131, 87, 32));
        btnGuan.setText("管理登陆");
        btnGuan.addActionListener(new ZhuFrame_jButton2_actionAdapter(this));
        jMenuItem3.setText("退出");
        jMenuItem3.addActionListener(new ZhuFrame_jMenuItem3_actionAdapter(this));
        btnTui.setBounds(new Rectangle(270, 131, 87, 32));
        btnTui.setText("退出");
        btnTui.addActionListener(new ZhuFrame_jButton3_actionAdapter(this));
        jMenuBar1.add(jMenu1);
        jMenu1.add(jMenuItem1);
        jMenu1.add(jMenuItem2);
        jMenu1.add(jMenuItem3);
        contentPane.add(btnShangwang);
        contentPane.add(btnGuan);
        contentPane.add(btnTui);
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
       Dimension frameSize = this.getSize();
       if (frameSize.height > screenSize.height) {
           frameSize.height = screenSize.height;
       }
       if (frameSize.width > screenSize.width) {
           frameSize.width = screenSize.width;
       }
       this.setLocation((screenSize.width - frameSize.width) / 2,
                    (screenSize.height - frameSize.height) / 2);

    }

    public void jButton1_actionPerformed(ActionEvent e) {
         DengFrame f=new DengFrame();
         f.setVisible(true);
         this.setVisible(false);
    }

    public void jButton2_actionPerformed(ActionEvent e) {
        RuanJianFrame f=new RuanJianFrame();
        f.setVisible(true);
                    this.setVisible(false);
    }

    public void jMenuItem1_actionPerformed(ActionEvent e) {
        DengFrame f=new DengFrame();
               f.setVisible(true);
         this.setVisible(false);
    }

    public void jMenuItem2_actionPerformed(ActionEvent e) {
        DengFrame f=new DengFrame();
                      f.setVisible(true);
         this.setVisible(false);
    }

    public void jMenuItem3_actionPerformed(ActionEvent e) {
System.exit(1);
    }

    public void jButton3_actionPerformed(ActionEvent e) {
System.exit(1);
    }
}


class ZhuFrame_jButton3_actionAdapter implements ActionListener {
    private ZhuFrame adaptee;
    ZhuFrame_jButton3_actionAdapter(ZhuFrame adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.jButton3_actionPerformed(e);
    }
}


class ZhuFrame_jMenuItem3_actionAdapter implements ActionListener {
    private ZhuFrame adaptee;
    ZhuFrame_jMenuItem3_actionAdapter(ZhuFrame adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.jMenuItem3_actionPerformed(e);
    }
}


class ZhuFrame_jMenuItem2_actionAdapter implements ActionListener {
    private ZhuFrame adaptee;
    ZhuFrame_jMenuItem2_actionAdapter(ZhuFrame adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.jMenuItem2_actionPerformed(e);
    }
}


class ZhuFrame_jMenuItem1_actionAdapter implements ActionListener {
    private ZhuFrame adaptee;
    ZhuFrame_jMenuItem1_actionAdapter(ZhuFrame adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.jMenuItem1_actionPerformed(e);
    }
}


class ZhuFrame_jButton2_actionAdapter implements ActionListener {
    private ZhuFrame adaptee;
    ZhuFrame_jButton2_actionAdapter(ZhuFrame adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.jButton2_actionPerformed(e);
    }
}


class ZhuFrame_jButton1_actionAdapter implements ActionListener {
    private ZhuFrame adaptee;
    ZhuFrame_jButton1_actionAdapter(ZhuFrame adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.jButton1_actionPerformed(e);
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -