Re: Displaying an alert box
Re: Displaying an alert box
- Subject: Re: Displaying an alert box
- From: Simon Wright <email@hidden>
- Date: Sat, 13 Oct 2001 21:32:57 -0400
On Saturday, October 13, 2001, at 08:30 PM, David McCabe wrote:
Greetings,
I would like to have my application display an alert panel which comes to
the foreground above all other applications. Despite the simplicity of
this task, I have found nothing in the documentation about displaying
alerts of any kind, except a small bit on sheets. Can any of you help?
Thanks!
Here is what I do for an alert...
private void myAlert (String title, String message) {
NSApplication.beep();
NSAlertPanel alert = new NSAlertPanel();
alert.runAlert(title, message, null, null, null);
}
And here's a confirm...
private boolean myConfirm (String title, String message, String yesText,
String noText) {
NSApplication.beep();
NSAlertPanel alert = new NSAlertPanel();
return (alert.runAlert(title, message, yesText, noText, null) ==
NSAlertPanel.DefaultReturn);
}
HTH
Simon