messagebox.java

来自「导出ORACLE数据库对象DDL语句的程序」· Java 代码 · 共 45 行

JAVA
45
字号
package com.icbcsdc.ddlexp.pub.util;

import javax.swing.JFrame;
import javax.swing.JOptionPane;


/**
 * @author zhangyc
 *
 * To change this generated comment edit the template variable "typecomment":
 * Window>Preferences>Java>Templates.
 * To enable and disable the creation of type comments go to
 * Window>Preferences>Java>Code Generation.
 */
public class MessageBox {

	/**
	 * Constructor for MessageBox.
	 */
	public MessageBox() {
		super();
	}

	public static void showErr(JFrame parent,String msg){
		JOptionPane.showMessageDialog(parent,msg, "alert", JOptionPane.ERROR_MESSAGE); 
	
	}
	
	public static void showErr(JFrame parent,String msg,String title){
		JOptionPane.showMessageDialog(parent, msg, title, JOptionPane.ERROR_MESSAGE); 
	
	}
	
	public static void showMessage(JFrame parent,String msg){
		JOptionPane.showInternalMessageDialog(parent, msg,"information", JOptionPane.INFORMATION_MESSAGE);	
	}
	
	public static void showMessage(JFrame parent,String msg,String title){
		JOptionPane.showInternalMessageDialog(parent, msg,title, JOptionPane.INFORMATION_MESSAGE);	
	}
	
	public static void main(String[] args) {
	}
}

⌨️ 快捷键说明

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