import org.openide.DialogDisplayer; import org.openide.DialogDescriptor;
DialogDisplayer.getDefault().notify(d) //d = Objekt (Typ NotifyDescriptor)
NotifyDescriptor d = new NotifyDescriptor( String Nachricht, String Titel, Typ von Button (YES_NO_OPTION), Typ der Nachricht (Info Message), null, null);
import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; public class DialogDemo { public static void main(String[] args) { NotifyDescriptor nd = new NotifyDescriptor.Confirmation( "Wählen Sie aus ja nein und abbrechen!", //Nachricht "Bitte wählen", //Titel der Nachricht NotifyDescriptor.YES_NO_OPTION, //Ja nein Abfrage NotifyDescriptor.QUESTION_MESSAGE); //Typ der Nachricht DialogDisplayer.getDefault().notify(nd); //Nachricht darstellen if (nd.getValue().equals(NotifyDescriptor.YES_OPTION)){ //Antwort abfragen und in Konsole ausgeben. System.out.println("Ihre Antwort war JA!"); } else if (nd.getValue().equals(NotifyDescriptor.NO_OPTION)){ System.out.println("Ihre Antwort war NEIN!"); } } }