O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Postcard

MessageDialog, QuestionDialog, and YesNoDialog all extend WorkDialog, and all provide the means to add not only text to the dialog, but an image as well. Figure 22-2 shows instances of MessageDialog, QuestionDialog, and YesNoDialog doing their thing.

Figure 22-2. Message, Question, and Yes/No Dialogs Message, question, and yes/no dialogs can be fitted with an image and a panel.

Naturally, we don't want to reimplement the code for placing an image next to a panel in each dialog class, so that functionality is embedded in the Postcard class, which is listed in Example 22-4.

Example 22-4. Postcard Class Listing
 import java.awt.*; public ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required