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

📄 confirmchange.java

📁 一个KTV管理系统
💻 JAVA
字号:
package view.mainframe.systemmaintenance;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

import view.loginframe.Login;
import view.mainframe.MainFrame;

import common.centerwindow.CenterWindow;

public class ConfirmChange extends JFrame implements ActionListener {

	private static ConfirmChange instance = null;
	private JPanel jContentPane = null;
	private JLabel tipLabel = null;
	private JButton okButton = null;
	private JButton escButton = null;

	public static ConfirmChange getInstance(){
		if(instance == null){
			instance = new ConfirmChange();
		}
		instance.setVisible(true);
		return instance;
	}
	/**
	 * This is the default constructor
	 */
	private ConfirmChange() {
		super();
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(264, 213);
		this.setContentPane(getJContentPane());
		this.setTitle("换班登陆");	
		this.setResizable(false);
		this.addWindowListener(new WindowAdapter(){
 			public void windowClosing(WindowEvent e) {
				// TODO Auto-generated method stub
 				ConfirmChange temp = (ConfirmChange)e.getSource();
				temp.setVisible(false);
				temp.dispose();
			}
 		});
		new CenterWindow().centerWindow(this);
		this.setVisible(true);
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			tipLabel = new JLabel();
			tipLabel.setBounds(new java.awt.Rectangle(67,49,141,36));
			tipLabel.setText("你确定要换班登陆吗?");
			jContentPane = new JPanel();
			jContentPane.setLayout(null);
			jContentPane.add(tipLabel, null);
			jContentPane.add(getOkButton(), null);
			jContentPane.add(getEscButton(), null);
		}
		return jContentPane;
	}

	/**
	 * This method initializes okButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getOkButton() {
		if (okButton == null) {
			okButton = new JButton();
			okButton.setBounds(new java.awt.Rectangle(17,105,72,27));
			okButton.setText("确定");
			okButton.addActionListener(this);
		}
		return okButton;
	}

	/**
	 * This method initializes escButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getEscButton() {
		if (escButton == null) {
			escButton = new JButton();
			escButton.setBounds(new java.awt.Rectangle(175,105,63,24));
			escButton.setText("取消");
			escButton.addActionListener(this);
		}
		return escButton;
	}

	public void actionPerformed(ActionEvent e) {
		JButton temp = (JButton)e.getSource();
		if(temp.getText().equals("取消")){
			this.setVisible(false);
			this.dispose();
		}
		if(temp.getText().equals("确定")){
			this.setVisible(false);
			this.dispose();
			
			MainFrame.getInstance().setVisible(false);			
			MainFrame.getInstance().jFrameMainFrame.setVisible(false);
			Login.getInstance();
		}
	}

}  //  @jve:decl-index=0:visual-constraint="218,89"

⌨️ 快捷键说明

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