gload.java

来自「在管理员表中初始插入数据 usn: admin, pwd: 21232F297A」· Java 代码 · 共 58 行

JAVA
58
字号
import javax.swing.*;

import java.awt.*;
import javax.swing.text.JTextComponent;

public class Gload {
	public static Dimension de = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
	public static String usn = "";
	public static String pwd = "";
	public static String AppTitle = "图书管理";
	public static int YES = JOptionPane.OK_OPTION;
	public static int NO = JOptionPane.NO_OPTION;
	public static int RowNum = 54;
	public static int slcID = -1;
	
	public static String getText(JTextComponent ip) {
		if (ip == null)
			return "";
		String s = ip.getText();
		return s.replaceAll("'", "''");
	}
	
	public static void checkLogin(Component parent) {
		if (usn.equals("")) {
			MSG(parent, "非法进入", "警告");
			System.exit(1);
		}
	}

	public static void MSG(Component parent, String msg, String title) {
		JOptionPane.showMessageDialog(parent, msg, title, JOptionPane.OK_OPTION);
	}
	public static void MSG(Component parent, String msg) {
		MSG(parent, msg, "提示");
	}

	public static int Confirm(Component parent, String msg, String title) {
		return JOptionPane.showConfirmDialog(parent, msg, title, 0);
	}
	public static int Confirm(Component parent, String msg) {
		return Confirm(parent, msg, "确认");
	}

	public static void exit() {
		Conn.close();
		System.exit(0);
	}

	public static boolean checkNumber(String s) {
		try {
			Double.parseDouble(s);
			return true;
		} catch (Exception e) {
			return false;
		}
	}
}

⌨️ 快捷键说明

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