package awt; import java.awt.*; import java.awt.event.*;
This class has two possible uses: MODAL: when you call getResult(), blocks all other user input until a choice is made; then returns this choice. NON-MODAL: shows itself when you call getResult(). In this case, getResult() always returns null. The dialog window will close automatically when the user picks a button. If you want to do something when that happens, use the result of addButton() to add an ActionListener. @author Geert Vernaeve |
Show an exception You cannot add more buttons since it is shown immediately! |
Show a one-line message and one button You cannot add more buttons since it is shown immediately! |
Add a custom component |
Helper function |
If the dialog is modal: Wait until the user has made a choice. Then return result. If the dialog is not modal: return result or null if the user hasn't chosen any button yet. Warning: only call this method once, then buffer the resulting string. Calling this method twice causes the dialog to pop up twice ... |