• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Displaying an alert box
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Displaying an alert box
      • From: David McCabe <email@hidden>
  • Prev by Date: Displaying an alert box
  • Next by Date: Image Capture
  • Previous by thread: Re: Displaying an alert box
  • Next by thread: Re: Displaying an alert box
  • Index(es):
    • Date
    • Thread