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

📄 ynpoint.java

📁 教材订购系统
💻 JAVA
字号:
package program;

import javax.swing.JPanel;

import java.awt.Dimension;
import java.awt.Frame;
import java.awt.BorderLayout;
import java.awt.Toolkit;

import javax.swing.JDialog;
import javax.swing.JLabel;
import java.awt.Rectangle;
import javax.swing.JButton;

public class YNPoint extends JDialog {

	private static final long serialVersionUID = 1L;

	private JDialog jDialog = null;
	
	private JPanel jContentPane = null;

	private JLabel jLabel = null;

	private JButton jButton = null;

	private JButton jButton1 = null;

	/**
	 * @param owner
	 */
	public YNPoint(Frame owner,String str) {
		super(owner);
		jDialog = this;
		initialize(str);
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize(String str) {
		this.setSize(300, 200);
		this.setTitle("提示");
		this.setContentPane(getJContentPane(str));
		jDialog.setVisible(true);
		
		jDialog.setResizable(false); //锁定JFrame
		Toolkit tkit = Toolkit.getDefaultToolkit();
        Dimension screenSize = tkit.getScreenSize();
        Dimension frameSize =  jDialog.getSize();
        if(frameSize.height>screenSize.height){
			frameSize.height=screenSize.height;
		}
		if(frameSize.width>screenSize.width){
			frameSize.width=screenSize.width;
		}
        jDialog.setLocation((screenSize.width-frameSize.width)/4, 
        		           (screenSize.height-frameSize.height)/4);
		
		jDialog.setVisible(true);
		jDialog.addWindowListener(new java.awt.event.WindowAdapter() {
			public void windowClosing(java.awt.event.WindowEvent e) {
				jDialog.setVisible(false);
			}
		});
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane(String str) {
		if (jContentPane == null) {
			jLabel = new JLabel();
			jLabel.setBounds(new Rectangle(29, 31, 236, 83));
			jLabel.setText("<HTML>*********************注意*********************<br>***********此操作涉及核心数据库**********<br>**********非专业人员请小心操作***********</HTML>");
			jContentPane = new JPanel();
			jContentPane.setLayout(null);
			jContentPane.add(jLabel, null);
			jContentPane.add(getJButton(str), null);
			jContentPane.add(getJButton1(), null);
		}
		return jContentPane;
	}

	/**
	 * This method initializes jButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton(final String str) {
		if (jButton == null) {
			jButton = new JButton();
			jButton.setBounds(new Rectangle(58, 119, 60, 32));
			jButton.setText("是");
			jButton.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					Bupdate bu;
					if(str.equals("insert"))
						bu = new Bupdate("insert");
					else if(str.equals("update"))
						bu = new Bupdate("update");
					else if(str.equals("delete"))
						bu = new Bupdate("delete");
					
					jDialog.setVisible(false);
				}
			});
		}
		return jButton;
	}

	/**
	 * This method initializes jButton1	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton1() {
		if (jButton1 == null) {
			jButton1 = new JButton();
			jButton1.setBounds(new Rectangle(178, 119, 61, 31));
			jButton1.setText("否");
			jButton1.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					jDialog.setVisible(false);
				}
			});
		}
		return jButton1;
	}

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

⌨️ 快捷键说明

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