ButtonPanel

WorkDialog provides two methods for adding a button to the button panel—one that takes a string and another that takes a button. Notice that the WorkDialog add methods simply delegate to their enclosed instance of ButtonPanel, so without further ado, let's take a look at the implementation of ButtonPanel in Example 22-3.

Example 22-3. ButtonPanel Class Listing
 import java.awt.*; public class ButtonPanel extends Panel { Panel buttonPanel = new Panel(); Separator separator = new Separator(); public ButtonPanel() { this(Orientation.CENTER); } public ButtonPanel(Orientation orientation) { int buttonPanelOrient = FlowLayout.CENTER; setLayout(new ...

Get Graphic Java™ 1.2, Volume I: AWT, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.