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

📄 deletedialog.java

📁 图书管理系统 运行环境 windows 2003 windows xp
💻 JAVA
字号:
package com.book.ui;

import java.awt.GridLayout;

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

import com.book.service.BookServiceImp;

public class DeleteDialog extends JFrame {

	private JPanel jContentPane = null;

	private JButton butConfirm = null;

	private JPanel jPanel = null;

	private JPanel jPanel1 = null;

	private JButton butCancel = null;

	private JLabel jLabel = null;

	private String deleteid = null;

	/**
	 * This is the default constructor
	 */
	public DeleteDialog(String deleteID) {
		super();
		this.deleteid = deleteID;
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(231, 108);
		this.setLocation(200, 300);
		this.setTitle("确认对话框");
		this.setContentPane(getJContentPane());
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			GridLayout gridLayout = new GridLayout(2, 1);
			jContentPane = new JPanel();
			jContentPane.setLayout(gridLayout);
			jContentPane.add(getJPanel(), null);
			jContentPane.add(getJPanel1(), null);
		}
		return jContentPane;
	}

	/**
	 * This method initializes butConfirm
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getButConfirm() {
		if (butConfirm == null) {
			butConfirm = new JButton();
			butConfirm.setText("确定");
			butConfirm.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					BookServiceImp sv = new BookServiceImp();
					sv.delete(deleteid);
					MainForm main = new MainForm();
					main.setVisible(true);
					setVisible(false);
				}
			});
		}
		return butConfirm;
	}

	/**
	 * This method initializes jPanel
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJPanel() {
		if (jPanel == null) {
			jLabel = new JLabel();
			jLabel.setText("是否删除这条数据!");
			jPanel = new JPanel();
			jPanel.add(jLabel, null);
		}
		return jPanel;
	}

	/**
	 * This method initializes jPanel1
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJPanel1() {
		if (jPanel1 == null) {
			jPanel1 = new JPanel();
			jPanel1.add(getButConfirm(), null);
			jPanel1.add(getButCancel(), null);
		}
		return jPanel1;
	}

	/**
	 * This method initializes butCancel
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getButCancel() {
		if (butCancel == null) {
			butCancel = new JButton();
			butCancel.setText("取消");
			butCancel.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					setVisible(false);
				}
			});
		}
		return butCancel;
	}

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

⌨️ 快捷键说明

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