Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Sometimes you need to ask a user for some text input. For example, you may need them to enter a username, password, or some other kind of detail. To do that, use display dialog but add a default answer clause to the end of it.
The default answer doesn't have to contain anything at all; just a "" will do. However, feel free to enter whatever appropriate text might help the user make a good entry. For example, here's a simple dialog that asks for the user's favorite color. Notice that the default answer clause is empty, and so is the accompanying user input widget (Figure 10.7):