public static void showMessageDialog(Component parentComponent, Object message, String title, int messageType) Parameters:parentComponent - determines the Frame in which the dialog is displayed; if null, or if the parentComponent has no Frame, a default Frame is used message - the Object to display title - the title string for the dialog messageType - the type of message to be displayed: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE eg..JOptionPane.showMessageDialog();
可以实现普通的对话框,也可以调用javascript 弹出对话框,我就给你介绍一下实现普通对话框吧 :Dialog d = new Dialog(new Frame(),"title",true); (参数按照Dialog的构造函数来) 简单吧?我开始遇到这个问题时,也是不知道怎么办好,他非要一个Frame或Dialog 作第一个参数,我后来自己试着玩,想到了这招。而且也有模式和非模式两种,就是把True改成False拉 用javascript 的话就完全是调用JS的问题了,网上很多资料的。
JOptionPane看看这个类就行了
Object message,
String title,
int messageType)
Parameters:parentComponent - determines the Frame in which the dialog is displayed; if null, or if the parentComponent has no Frame,
a default Frame is used
message - the Object to display
title - the title string for the dialog
messageType - the type of message to be displayed:
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
eg..JOptionPane.showMessageDialog();
简单吧?我开始遇到这个问题时,也是不知道怎么办好,他非要一个Frame或Dialog 作第一个参数,我后来自己试着玩,想到了这招。而且也有模式和非模式两种,就是把True改成False拉
用javascript 的话就完全是调用JS的问题了,网上很多资料的。